1 Reply Latest reply: Jun 17, 2008 5:11 AM by (Lee_Sutton) RSS

    String Value of Barcode

    Community Member
      We're using Code128 barcodes with a 14 character identifier. I've been able to get the xml of the barcode using decode, but is there an easier way to get the value from the xml than using xpath? I just want a string with a value like 12345678001002. This is the xml result:<br /><br />><?xml version="1.0" ?> <br /> <xb:scanned_image path="pdf" version="1.0" xmlns:xb="http://decoder.barcodedforms.adobe.com/xmlbeans"><br />      <xb:decode><br />            <xb:date>2008-06-16T14:36:30.670-04:00</xb:date> <br />            <xb:host_name> </xb:host_name> <br />           <xb:status type="success"><br />                 <xb:message /> <br />            </xb:status><br />       </xb:decode><br /> <xb:barcode id="1"><br />      <xb:header symbology="code128"><br />        <xb:location page_no="1"><br />          <xb:coordinates><br />            <xb:point x="0.0" y="0.0" /> <br />          <xb:point x="1.0" y="0.0" /> <br />          <xb:point x="1.0" y="1.0" /> <br />          <xb:point x="0.0" y="1.0" /> <br />         </xb:coordinates><br />       </xb:location><br />       </xb:header><br />      <xb:body><br />           <xb:content encoding="utf-8">666666002004</xb:content> <br />        </xb:body><br />  </xb:barcode><br /></xb:scanned_image><br /><br />If I do try to use extractToXml (and I don't have any deliminated data) I get an invalidOperationException, saying <br /><br />>" System.Xml.XmlException: The 'document' start tag on line 1 does not match the end tag of 'barcode'. Line 2, position 36. "
        • 1. Re: String Value of Barcode
          Community Member
          The extractToXML service should be used on data that is extracted from the 2D barcodes that have been encoded using the tab-delimited format including field names.

          In your case, simply use the Decode service and then use the Set service to move the value from the //content element into your variable.