AnsweredAssumed Answered

XML Puzzler

Question asked by jerrysalem on Apr 24, 2018
Latest reply on Apr 28, 2018 by fmpdude

A buddy of mine has a database for his print shop.  He needs to grab info from a web service to create another file to export.

 

I get an XML file from an art supplier.  I don’t need (or want) to write XSLT to import the data to a new table.

But I do need to extract some data.

 

Here is a portion of the data;

….

<cLookup>Aqua</cLookup><amount>45</amount ><cDetailType>S</cDetailType></record><record>

<cLookup>Blue</cLookup><amount >355</amount ><cDetailType>S</cDetailType></record><record>

<cLookup>Cherry Red</cLookup><amount >12</amount ><cDetailType>S</cDetailType></record>

….

 

I need to fine the value of the ‘amount’ Node for a specific ‘cLookup’ Node.

 

For example; what is the amount for cLookup = “Blue”?

The answer is 355

 

How would you do this?  I have a solution but it isn’t robust enough, so I was wondering how others would approach this.

Of course I will share my solution too!

Outcomes