Zebra Enterprise Connector fails to parse XML Report

Article ID: 07806171

Details


 

Topic or Information

Using Zebra Enterprise Connector to manage print jobs from Oracle

Applies To

Zebra Enterprise Connector (ZEC)

Details

Zebra Enterprise Connector (ZEC), available at www.zebra.com/enterpriseconnector, is the Zebra tool used to interface Oracle report generation tools with Zebra printers.  At its core, ZEC parses the output Oracle XML reports, merges them with ZPL templates, and sends the created labels out to print.  All of this is done without user intervention.  Depending on which Oracle module is being used, differences can arise in Oracle's generated XML reports that ZEC must account for.  If ZEC is reporting an XML parsing error and failing to send print jobs, consider the following:
 

The XML Report Must Use Variable Names for Tags

ZEC uses variables in the ZPL templates and in the XML reports to correlate which portions of the ZPL template are to be filled by the XML data.  Some Oracle setups generate XML reports where all tags are 'variable' tags with 'name' attributes.  In this situation, the name attributes correspond to the ZPL variables to be populated when merged.  ZEC, however, will be expecting an XML report formatted such that the tags are the actual variable names with no attributes.  As an example:

User-added image

If the XML reports being generated follow the format on the left, then you must create an .XSL file that will help ZEC transform the file to the appropriate format.  A complete walk-through on this topic is available in the ZEC manual, available at www.zebra.com/enterpriseconnector.  Once the .xsl file is placed in ZEC's xsl directory, the reports will be transformed into the appropriate format before merging with the ZPL templates.

 

 DOCTYPE Declarations Require a DTD File

Some Oracle setups generate a DOCTYPE declaration near the top of an XML report.  This declaration refers to a Document Type Definition (DTD) that defines the structure that an XML document should maintain, as well as what tags are, and other elements that are supported.  The declaration itself will take this format:

<!DOCTYPE labels SYSTEM "label.dtd">

If you notice a DOCTYPE declaration being generated in your Oracle XML Report, you will have to place the corresponding DTD in ZEC's tmp folder, by default located in /opt/zebra_ec/tmp/.  Without this DTD in place, ZEC will fail to parse the XML report.  A sample DTD will look like this:

label.dtd

<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT labels (label)>
<!ATTLIST labels
          _QUANTITY CDATA #IMPLIED
          _PRINTERNAME CDATA #IMPLIED
          _JOBNAME CDATA #IMPLIED>
<!ELEMENT label (variable+)>
<!ATTLIST label
          _FORMAT CDATA #REQUIRED>
<!ELEMENT variable (#PCDATA)>
<!ATTLIST variable
          name CDATA #REQUIRED>