Structure XML nodes using DOM in ABL

Status
Not open for further replies.
W

WingNut86

Guest
I'm creating an XML file using ABL. I want the detail node to fall below field3 like this:

+<root>
+<header>
<field1>some data</field1>
<field2>some data</field2>
<field3>some data</field3>
+<detail>
<field4>some data</field4>
</detail>
</header>
</root>


However, this is what's happening when the XML file is saved. The detail falls directly under the header node.

+<root>
+<header>
+<detail>
<field4>some data</field4>
</detail>
<field1>some data</field1>
<field2>some data</field2>
<field3>some data</field3>
</header>
</root>


Is there a method I can use or specific way I need to order/structure my code to achieve this?

Here is the code for the node creation:

hDoc:CREATE-NODE(hRoot,"root","ELEMENT").
hDoc:APPEND-CHILD(hRoot).

hDoc:CREATE-NODE(hHeader,"header","ELEMENT").
hRoot:APPEND-CHILD(hHeader).

hDoc:CREATE-NODE(hDetail,"detail","ELEMENT").
hHeader:APPEND-CHILD(hDetail).


I'm adding the value's for the detail node after field 1-3.

Any help would be appreciated.

Thanks.

Continue reading...
 
Status
Not open for further replies.
Top