XML Rules Including Special Characters

Article ID: 51664786



Topic or Information

Generating proper XML and printing special characters

Applies To

XML-Enabled Printers


Included are rules for generating proper XML and for printing some XML special characters

XML Rules Including Special Characters


  • Open and close all tags
  • Empty tags end with />
  • Elements may not overlap
  • Attribute values are quoted “
  • < and & are only used to start tags and entities
  • XML has only five predefined internal entity references:

< > & ” ’

Your XML data stream cannot contain any of the above characters sets. However, if this is part of your data element, you would need to use the following alternate values:

& use &amp;

< use &lt;

> use &gt;

 use &apos;

 use &quot;


If you need to print the following - Dr Jekyll & Mr. Hyde  - in a XML data stream. It would look like this:

<variable name="COMPANY_NAME">Dr. Jekyll &amp; Mr. Hyde</variable>

This is true for both text and barcodes. A bar code that supports the & character would also require a change to the XML data stream.


If you need to print the following - 123&456 - in a XML data stream. It would look like this:

<variable name="BARCODE_DATA">123&amp;456</variable>


Without all of the correct parts of the necessary XML data stream no bar code will print. & the word amp and the ; (semicolon) are all required for the bar code to print. 


+ Product Codes

  • 105SLPlus Industrial Printers
  • 105SLPlus Industrial Printers
  • 110PAX Print Engines (disc.)
  • 110Xi4 Industrial Printer
  • 140Xi4 Industrial Printer
  • 170Xi4 Industrial Printer
  • 220Xi4 Industrial Printer
  • 2824 Plus Series
  • All Surface RFID Label Solution
  • Desktop Printers
  • G-Series GC Desktop Printers
  • G-Series GK Desktop Printers
  • G-Series GX Desktop Printers
  • GC420d Desktop Printer
  • GC420t Desktop Printer
  • GK420 Healthcare Desktop Printers
  • GK420d Desktop Printer
  • GK420d Healthcare Desktop Printer
  • GK420t Desktop Printer
  • GK420t Healthcare Desktop Printer
  • GT800 Desktop Printer
  • GX420t Desktop Printer
  • GX430d Desktop Printer
  • GX430t Desktop Printer
  • Industrial Printers
  • LP 2824 Plus Desktop Printer
  • Print Engines
  • R110Xi4 RFID Printer
  • S4M
  • S4M Series
  • TLP 2824Plus Desktop Printer
  • Xi Series Industrial Printers
  • Z Series Industrial Printers
  • ZD410 Series
  • ZD410D
  • ZD420 Series
  • ZD420-HC
  • ZD420C
  • ZD500 Desktop Printer
  • ZD500 Desktop Printer
  • ZD500R RFID Printers
  • ZD500R RFID Printers
  • ZE500 Print Engines
  • ZE500 Print Engines
  • ZE500R RFID Print Engine
  • ZE500R RFID Print Engine
  • ZM400
  • ZM600
  • ZT200 Series Industrial Printers
  • ZT210 Industrial Printer
  • ZT220 Industrial Printer
  • ZT230 Industrial Printer
  • ZT400 Series Industrial Printers
  • ZT400 Series RFID Printers
  • ZT410 Industrial Printer
  • ZT410 RFID Industrial Printer
  • ZT420 Industrial Printer
  • ZT420 RFID Industrial Printer