Forum Discussion

Chuck_Micklavzi's avatar
Chuck_Micklavzi
Occasional Contributor
17 years ago

Node order using DOMCategory

I am experiencing an issue trying to add nodes using DOMCategory.  My Nodes are out of order.

Here is an example of the code:

When the object I am creating in specified in the xsd I use:
node.appendNode( new QName(myXsd, newNodeName), (newValue == null ? "" : newValue) );

If I am inserting a simple type:
node.appendNode( new QName( newNodeName), (newValue == null ? "" : newValue) );


Here is an example of the output:

     
       
           
            2697444730

        false

      1



But what I really need is:

     
        1
                   
            true
           
            2697444730

       

     


If I submit the request out of order I get an error response back indicating the request is out of order (expecting allStatus but getting searchCriteria).

Any suggestions as to how I can get everything in the correct order?

Chuck

2 Replies

  • Hi Chuck,


    Strictly speaking, an XML parser conforming to XML 1.0 specification is not guaranteed to return nodes in the order they're encountered. Obviously, your server-side request processor is not one of those.

    Before we answer you I need to make sure:
    Are you using Groovy script to append a blockNumber node?
    DomCategory.appendNode only allows appending a node, i.e. placing a newly instantiated node after an element.

    I'm sure we'll find a solution for you...

    BTW, it is recommended for pro users to post their questions in pro support forum so that they're prioritized and answered faster.


    Cheers!
    /Nenad Nikolic a.k.a. Shonzilla
  • Chuck_Micklavzi's avatar
    Chuck_Micklavzi
    Occasional Contributor
    Yes.  In Groovy Script using DOMCategory and appending a node as such.

    def node = soapReqHolder.getDomNode( parentNodeName );

    node.appendNode( new QName(myXsd, newNodeName), (newValue == null ? "" : newValue) );

    Chuck