generate xml

jbaltodano

New Member
i'm using {the code below} to generate an xml
DATASET dsDatos:WRITE-XML("STREAM",
"WEBSTREAM" ,
YES,
"iso8859-1",
?,
NO,
NO).

but the final result looks like
<dsdatos>
<param>
<tag_child>3</tag_child>
</param>
<item>
<child>abc</child>
<child1>abc</child1>
</item>
<item1>
<a_child>abc</a_child>
</item1>
<item1>
<a_child>abc</a_child>
</item1>
</dsdatos>

but i want the result looks like

<dsdatos>
<param>
<tag_child>3</tag_child>
</param>
<item>
<child>abc</child>
<child1>abc</child1>
</item>
<father>
<item1>
<a_child>abc</a_child>
</item1>
<item1>
<a_child>abc</a_child>
</item1>
</father>
</dsdatos>

how is that possible?
 
Not sure I got that right 'inferring' from XML, but you might look at 'nested' property of the data relation...

However if you have something like parent->child the xml will look like:

Code:
<parent>
   <parent fld1 />
   <parent fld2 />
   ...
   <parent fldN />
   <child>
      <child fld1 />
      ...
      <child fldN />
   </child>
   ...
   <child/>
</parent>

if you need to have the child records grouped in a 'childs' tag then you need an extra 'relation' table to be added to get the write-xml to output something like
Code:
<parent>
   <parent fld />
   <childs>
      <child />
      ...
      <child />
   </childs>
</parent>
 
Back
Top