LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Help on XML Nodes in LAL Pack

    Employee
    Posted 09-25-2014 07:51

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: xathras

    Guys, I am stuck I have some XML that I need to transform to get results into tabular form. I tried the LAL nodes and can't get it working.

    Attached is the XML file I have and results I would like:
    Working on 4.6.0 with must recent LAL Pack including installation on Enterprise Server

    Can anyone help and provide an example?

    Much appreciated.

    wayne
    Attachments:
    example.txt
    dataandexpected.zip


  • 2.  RE: Help on XML Nodes in LAL Pack

    Employee
    Posted 09-25-2014 08:04

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Tim Meagher

    Hi,

    Which LAL nodes are you attempting to use?
    Probably the easiest to configure is the XML Data node, however that is only supported using LAE 4.6.1 and later...

    Regards,
    Tim.


  • 3.  RE: Help on XML Nodes in LAL Pack

    Employee
    Posted 09-25-2014 09:19

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: xathras

    Tim I tried the tabular data node and get the following error:

    No output produced. No tags matched the RecordXPath expression [/products/product]. Therefore, no output records were produced.

    Here is what I had for the node:
    node:Tabular_XML_File
    bretype:lal1::Tabular XML File
    editor:sortkey=5424261723300a73
    output:@4ff6f823382e2d4b/=
    prop:File=/tmp/soap.xml
    prop:FileParamType=Literal
    prop:RecordXPath=/products/product
    editor:XY=530,560
    end:Tabular_XML_File

    One of my weakest knowledge in dealing with processing of it. I understand the data and what I want. But dont know how to process it.

    Wayne


  • 4.  RE: Help on XML Nodes in LAL Pack

    Employee
    Posted 09-28-2014 14:55

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: xathras

    Any body able to help?


  • 5.  RE: Help on XML Nodes in LAL Pack

    Employee
    Posted 09-29-2014 02:15

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: rpigneri

    Hello, 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


  • 6.  RE: Help on XML Nodes in LAL Pack

    Employee
    Posted 10-02-2014 12:02

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: xathras

    Thank you Rocco I learnt something new :-). need to play with some more of the complex elements. Would be great if you could provide detail on redemption too.


  • 7.  RE: Help on XML Nodes in LAL Pack

    Employee
    Posted 10-06-2014 03:47

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: rpigneri

    Dear Wayne,

    Hope you had good weekend. The Tabular XML Data node provides extensive documentation so the solution was a simple cut and paste. The node help for the Tabular XML node outlines a few cases that the Tabular XML node supports. In this case, Case IV is most like the data that you have. I then simply added a function provided in the FieldNameFunction node help to produce the attached results.

    Hope that helps,

    Rocco

    solution.brg