S
Scott Lyon
I need to build a complex XML document. By complex, it has many elements
embedded within other elements.
At first I was hoping I could build a DataSet, and then just use the
WriteXML method to save the file. Unfortunately, I'm not having much luck
with that (I cannot figure out how to build the parent/child relationships).
Let me give an example.
I need to create the following XML (the format is not up to me, so please
don't suggest that I simplify the output structure, as that is out of my
control):
<document>
<header>
<title>Fred</title>
<page>1</page>
</header>
<item>
<number>123</number>
<name>
<value>test1</value>
</name>
</item>
<item>
<number>456</number>
<name>
<value>test2</value>
</name>
</item>
Now, I can create the <document> and <header>/<item> level elements. But I
cannot seem to create the elements within those (especially <name> in
<item>, as that contains elements itself) using the DataSet object.
What is going to be the best/easiest way to do this?
Thanks!
-Scott
embedded within other elements.
At first I was hoping I could build a DataSet, and then just use the
WriteXML method to save the file. Unfortunately, I'm not having much luck
with that (I cannot figure out how to build the parent/child relationships).
Let me give an example.
I need to create the following XML (the format is not up to me, so please
don't suggest that I simplify the output structure, as that is out of my
control):
<document>
<header>
<title>Fred</title>
<page>1</page>
</header>
<item>
<number>123</number>
<name>
<value>test1</value>
</name>
</item>
<item>
<number>456</number>
<name>
<value>test2</value>
</name>
</item>
Now, I can create the <document> and <header>/<item> level elements. But I
cannot seem to create the elements within those (especially <name> in
<item>, as that contains elements itself) using the DataSet object.
What is going to be the best/easiest way to do this?
Thanks!
-Scott