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.  XMLpy File node - xmlns

    Employee
    Posted 06-29-2015 14:05

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

    Originally posted by: Bryt Park

    Hi

    I am trying to use "XMLpy File" node to parse a XML file, however it only works on files with NO name space. How do I get it to work on files with name spaces?

    Another question: where there are repeated elements (child node "A2" below"), how can get all repeated elements in the result.

    I can NOT use "XML Data" node which is probably better designed to handle XML files, as I need to extract particular elements ( some are repeated elements) from a source file that contains one single giant message with complex message structure ( 8 - 10 layers of child nodes and attributes)

    Here's the script:
    data = {} 
    @elementHandler('/Root/A') 
    def EntryHandler(element): 
    	data['MsgId'] = str(element.A1)
    	outputRecord(data, 0)
    Here are the data:
    - With NameSpace
    <?xml version="1.0" encoding="UTF-8"?>
    <Root xmlns="http://www.a.org/a-5/a" >
    <A>
    <A1>X</A1>
    <A2>XA</A2>
    <A2>XB</A2>
    <A4>X</A4>
    </A>
    <B>X</B>
    <C>
    <partyReference href="X"/>
    </C>
    <D>X</D>
    </Root>

    -Without NameSpace
    <?xml version="1.0" encoding="UTF-8"?>
    <Root ABc="http://www.a.org/a-5/a" >
    <A>
    <A1>X</A1>
    <A2>X</A2>
    <A3>X</A3>
    <A4>X</A4>
    </A>
    <B>X</B>
    <C>
    <partyReference href="X"/>
    </C>
    <D>X</D>
    </Root>


  • 2.  RE: XMLpy File node - xmlns

    Employee
    Posted 06-30-2015 00:37

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

    Originally posted by: Tim Meagher

    Hi,

    The XMLpy File node does not support namespaces.
    I believe this post is also the same issue as mentioned here: http://community.lavastorm.com/threa...amespace-Issue and the solution will likely be the same for these issues.

    Regards,
    Tim.


  • 3.  RE: XMLpy File node - xmlns

    Employee
    Posted 06-30-2015 07:36

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

    Originally posted by: Bryt Park

    Hi Tim

    Glad someone else out there was looking for the solution too....

    What about 'Tabular XML File' node, looks like I can extract a specific element with it just like XMLpy File node. It also has a Namespace input area within, does that mean it can handle Name Spaces?

    If yes, How can I get it to extract all repeated elements not just the first one?