Expand my Community achievements bar.

Re-Using XML file from decode barcode + extract xml process

Avatar

Level 1

I was hoping someone could put me in the right direction here. I am decodeing the information stored in a 2D Bar code and sending this information to an XML file, then I am trying to combine that xml file with a blank PDF template but the process is failing beacuse there are some additional tag fields the XML data from the  Decode->Extract XML process.

The XML file from the decode process gives the structure below..notice therer some extra tags (lines 2- 4)

<?xml version="1.0" encoding="UTF-8"?>

<xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">

<xfa:datasets>

<xfa:data>

<form1>

The XML structure that is expected by the PDF template is as follows

<?xml version="1.0" encoding="UTF-8"?>

<form1>

So the xml output of the Decode barcode + Extract XML process has three extra lines of tag. Is there a way I could use a process within liveCycle to clean out those three lines in real-time before sending the xml to be recombined with the PDF template.

Thanks

2 Replies

Avatar

Level 4

You could probably create a very simple XSLT and run it on the XML variable returned from the Extract to XML service.

Avatar

Level 1

Hi,

What you may do is to use the SetValue and its xpath builder functions to "serialize" the xml into string, "substring" to remove the extra tags, and "concat" to add the extra tags and then "deserialize" it again to an xml to be merged with your form.

Greetings,

Yasser