Split XML
Posted: Tue Jun 19, 2018 11:20 pm
I am working on simple Switch flow for vdp using new barcode action from PitStop Server.
I have incoming xml with barcode values, I inject template pdf and needed barcode is generated by PS perfectly. No problems with this part.
But I find it really difficult to split incoming xml into several xml files named by barcode values. Could xsl transform do the job?
One option is to use csv and CSV2XML app from appstore instead but I would like to solve it without additional tools.
Can anyone guide me how to split xml without serious scripting or using additional tools?
Sample of xml I am using:
<field-list>
<field>
<tag>barcode</tag>
<type>string</type>
<required>true</required>
<value>01-01-01</value>
</field>
<field>
<tag>barcode</tag>
<type>string</type>
<required>true</required>
<value>01-02-01</value>
</field>
<field>
<tag>barcode</tag>
<type>string</type>
<required>true</required>
<value>01-03-01</value>
</field>
<field>
<tag>barcode</tag>
<type>string</type>
<required>true</required>
<value>01-04-01</value>
</field>
</field-list>
I have incoming xml with barcode values, I inject template pdf and needed barcode is generated by PS perfectly. No problems with this part.
But I find it really difficult to split incoming xml into several xml files named by barcode values. Could xsl transform do the job?
One option is to use csv and CSV2XML app from appstore instead but I would like to solve it without additional tools.
Can anyone guide me how to split xml without serious scripting or using additional tools?
Sample of xml I am using:
<field-list>
<field>
<tag>barcode</tag>
<type>string</type>
<required>true</required>
<value>01-01-01</value>
</field>
<field>
<tag>barcode</tag>
<type>string</type>
<required>true</required>
<value>01-02-01</value>
</field>
<field>
<tag>barcode</tag>
<type>string</type>
<required>true</required>
<value>01-03-01</value>
</field>
<field>
<tag>barcode</tag>
<type>string</type>
<required>true</required>
<value>01-04-01</value>
</field>
</field-list>