Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: rpigneriHello, Wayne! Hope everything is going well.
If I remember correctly, you are working on 4.6.0, hence why you did not respond about the XML Data node available in 4.6.1 and beyond. That's a pity because that node makes most XML parsing simply painless.
Looking at your XML file, I see that you are processing SOAP responses. SOAP is a little tricky because it uses namespaces. Looking at the top, I see this:
<?xml version="1.0" encoding="UTF-8"?><prod:GetApplicableProductsResponse xmlns:prod="http://name.com/ws/2.0/productcatalog">
We'll ignore that
<?xml bit for a second--it's excitedly named the 'XML Declaration' for those interested--and focus on the second bit, the root element. The full root element is reproduced here:
<prod:GetApplicableProductsResponse xmlns:prod="http://name.com/ws/2.0/productcatalog">
You'll notice that this root element declares a namespace named 'prod'--that's the
xmlns:prod="http://name.com/ws/2.0/productcatalog" bit--and applies that namespace to the root element--that application is done via the
prod: before the
prod:GetApplicableProductsResponse. You'll also notice that all elements below the root element also have this namespace applied. XPath, the XML standard that the Tabular XML node uses to find elements, will not match an element that has a namespace if you don't also declare it in your XPath query.
In order to declare a namespace in the Tabular XML node, simply copy the namespace declaration, here
xmlns:prod="http://name.com/ws/2.0/productcatalog", into the Namespaces parameter. Then, in your RecordXPath, FieldNameXPath, and FieldValueXPath, prefix every node--XPath-speak for the parts between the slashes--with
prod:. Voil�, data!
I have attached a working example below. That gets rather close to your stated goal. You'll notice that there are two Tabular XML nodes. There are two because the Tabular XML node can only parse XML elements under a single RecordXPath. Since the currency is shared amongst all Products, you have to read that out separately and then join it together. I was also uncertain how to calculate the Redemption End value as I could not find the Redemption Start value.
This example intentionally does not read in the subelements in RedemptionWindow. If you would like to do that, please write back, and I can help you through that as well.
Hope that helps,
Rocco
solution.brg