cancel
Showing results for 
Search instead for 
Did you mean: 

XML Parsing To Get Values

matt_bostrom
New Contributor II

Hello I am receiving some XML in the following structure/format and want SnapLogic to convert each row to a document with the attributes as the value. So here is the sample of the XML coming in from a DB query where it is stored:

bac95df6dd8f6f875071ab91b040c738770eb0bf.png

When I tag on the XML Formatter and Parser it doesn’t seem to break it down for me with the retrievable values:

490bd60fdca2cbb3f1dfafa86db1f78a4dc07255.jpg

008ce310a9168820f5e9542546132c12226a8152.png

2 REPLIES 2

del
Contributor III

If you don’t need additional fields from the database other than the invoice XML, I think your solution would be to replace the XML Formatter snap with a Document to Binary snap and make sure your mapper maps the XML field name to “$content”

Example:

  • If Get Invoices has a statement like “Select invoiceXML from InvoiceTable”
  • The Mapper would map $invoiceXML to $content
  • The Document to Binary snap would have encoding set to “None”
  • XML Parser should then produce your expected results

matt_bostrom
New Contributor II

YES! that is perfect and it works for me. Thank you Del.