Breaking up an XML
Posted: Mon Nov 25, 2013 7:59 pm
Our usual flows are one XML and a PDF that were able to use XML Pickup with.
We now have a client suppling our order info as a single XML that refers to several PDFs.
Is there a way to have switch pluck out the multiple orders and write the separate XML files where the PDFs will be waiting?
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Order>
<OrderID>434590</OrderID>
<OrderDate>2013-11-20T20:25:58.577</OrderDate>
<OrderEmail>test@here.com</OrderEmail>
<OrderItem>
<OrderItemID>895</OrderItemID>
<ProductID>3149</ProductID>
<ProductName>Card</ProductName>
<LocationID></LocationID>
<LocationDesc></LocationDesc>
<FileName>20131120_202530.pdf</FileName>
<Recipient>
<Qty>50</Qty>
<ShipFirstName></ShipFirstName>
<ShipLastName></ShipLastName>
<ShipAddress1></ShipAddress1>
<ShipAddress2></ShipAddress2>
<ShipCity></ShipCity>
<ShipState></ShipState>
<ShipZip></ShipZip>
<ShipPhone></ShipPhone>
<ShipEmail></ShipEmail>
</Recipient>
</OrderItem>
<OrderItem>
<OrderItemID>1825</OrderItemID>
<ProductID>3150</ProductID>
<ProductName>Poster</ProductName>
<LocationID>6</LocationID>
<LocationDesc></LocationDesc>
<FileName>20131120_206630.pdf</FileName>
<Recipient>
<Qty>10</Qty>
<ShipFirstName></ShipFirstName>
<ShipLastName></ShipLastName>
<ShipAddress1></ShipAddress1>
<ShipAddress2></ShipAddress2>
<ShipCity></ShipCity>
<ShipState></ShipState>
<ShipZip></ShipZip>
<ShipPhone></ShipPhone>
<ShipEmail></ShipEmail>
</Recipient>
</OrderItem>
</Order>
So we'd like to write out in each new file
<OrderID>434590</OrderID>
<OrderDate>2013-11-20T20:25:58.577</OrderDate>
<OrderEmail>test@here.com</OrderEmail>
and then one each of <OrderItem>
saving the XML as the corresponding PDF in <FileName>
Is this possible? Or is there a secret feature of switch that makes this simple?
We now have a client suppling our order info as a single XML that refers to several PDFs.
Is there a way to have switch pluck out the multiple orders and write the separate XML files where the PDFs will be waiting?
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Order>
<OrderID>434590</OrderID>
<OrderDate>2013-11-20T20:25:58.577</OrderDate>
<OrderEmail>test@here.com</OrderEmail>
<OrderItem>
<OrderItemID>895</OrderItemID>
<ProductID>3149</ProductID>
<ProductName>Card</ProductName>
<LocationID></LocationID>
<LocationDesc></LocationDesc>
<FileName>20131120_202530.pdf</FileName>
<Recipient>
<Qty>50</Qty>
<ShipFirstName></ShipFirstName>
<ShipLastName></ShipLastName>
<ShipAddress1></ShipAddress1>
<ShipAddress2></ShipAddress2>
<ShipCity></ShipCity>
<ShipState></ShipState>
<ShipZip></ShipZip>
<ShipPhone></ShipPhone>
<ShipEmail></ShipEmail>
</Recipient>
</OrderItem>
<OrderItem>
<OrderItemID>1825</OrderItemID>
<ProductID>3150</ProductID>
<ProductName>Poster</ProductName>
<LocationID>6</LocationID>
<LocationDesc></LocationDesc>
<FileName>20131120_206630.pdf</FileName>
<Recipient>
<Qty>10</Qty>
<ShipFirstName></ShipFirstName>
<ShipLastName></ShipLastName>
<ShipAddress1></ShipAddress1>
<ShipAddress2></ShipAddress2>
<ShipCity></ShipCity>
<ShipState></ShipState>
<ShipZip></ShipZip>
<ShipPhone></ShipPhone>
<ShipEmail></ShipEmail>
</Recipient>
</OrderItem>
</Order>
So we'd like to write out in each new file
<OrderID>434590</OrderID>
<OrderDate>2013-11-20T20:25:58.577</OrderDate>
<OrderEmail>test@here.com</OrderEmail>
and then one each of <OrderItem>
saving the XML as the corresponding PDF in <FileName>
Is this possible? Or is there a secret feature of switch that makes this simple?