Previous Topic: Using Variables in Batch

Next Topic: SQL Server Types

Using Special XML Characters in Batch Files

There are a number of characters that require special treatment to include them as part of a string in xml files. This is important to be aware of when writing batch files.

Character

Character Name

Character as Used in XML Files

&

ampersand

&

<

Less than

&lt;

>

Greater than

&gt;

"

Quotation mark

&quot;

'

Apostrophe

&#39;

Invalid use of the & character in an XML string:

<Organization>Discovery & Auditing</Organization>

Valid use of the & character in an XML string XML:

<Organization>Discovery &amp; Auditing</Organization>

The '&' used in the invalid string is replaced by '&amp;' in the valid use of the XML string.