-
XML Question
Currently I have a dataset which contains two tables: Loads and Maps. Each load will contain at least one map but could contain more. I'm using a relational db schem where the load has a row ID (RID) and each map entry has a RID that is used to associate it to a load. My XML looks like this:
Code:
<Loads>
<desc>This is my Description</desc>
<options>-noio</options>
<loaded>0</loaded>
<rid>1</rid>
</Loads>
<Map>
<rid>1</rid>
<drive>S</drive>
<path>Some path</path>
</Map>
<Map>
<rid>1</rid>
<drive>R</drive>
<path>Some other path</path>
</Map>
This works but I would like to have the map data embedded in the Loads table:
Code:
<Loads>
<desc>This is my Description</desc>
<options>-noio</options>
<loaded>0</loaded>
<Maps>
<Map>
<drive>S</drive>
<path>Some path</path>
</Map>
<Map>
<drive>R</drive>
<path>Some other path</path>
</Map>
</Maps>
</Loads>
I'm using ds.writexml to populate the xml files. How would I organize the dataset to generate the example above?
-
Re: XML Question
I don't think the dataset allows you to embed children groups within a master. All it knows it that there are datatables that are linked through datarelations. If you want to generate proper XML then may be you should look at persisting custom objects as XML or programmatically fabricate the xml document.
-
Re: XML Question