Escaping entries in ADPlus config files

This is a useful point I saw discussed recently on some internal email. So I thought I would blog it before I lose it.

If you use ADPlus at all and make use of the (very useful) configuration file option you may have run into the situation where it complains about certain characters.

For example, suppose you want to include a custom action in the handling of a particular exception. You would probably try something like this:

<CustomActions1> .if (0n10 < ParamXYZ ) </CustomActions1>

But then you will get an error something like this:

C:Program FilesDebugging Tools for Windows>adplus -crash -pn MyTestApplication.exe -c MyConfigFile.cfg

*** ERROR ***

No matching closing tag in XML string [CustomActions1]. Check missing closing tag or use of invalid characters like '<' or '>' inside the tag.

 

Well, at least the error tells you what to look for and sure enough we are using a '<' inside a tag but what to do about it?

Answer is straightforward once you know - just use standard XML escaping techniques:

<CustomActions1> .if (0n10 &lt; ParamXYZ ) </CustomActions1>

HTH

Doug