Hi folks,
I have an Access application which takes an XML document and converts some attributes to tags ( see my previous topic: ).
I need to expand on this. I have a node called "view" and I need to convert its "name" attribute to a tag. This I do not have a problem with (thanks to oharab for that). But what I need to do is add that new "name" attribute to the "question" node. The "question" node is a child of "view".
In the xml there are multiple view nodes and each one has some "question" child nodes. So in each "view" node I need to create a tag in each "question" child node with a "name" text node.
So, from this...
...to this...
Hope somebody can help im really struggling with the XML DOM!
Thanks!
I have an Access application which takes an XML document and converts some attributes to tags ( see my previous topic: ).
I need to expand on this. I have a node called "view" and I need to convert its "name" attribute to a tag. This I do not have a problem with (thanks to oharab for that). But what I need to do is add that new "name" attribute to the "question" node. The "question" node is a child of "view".
In the xml there are multiple view nodes and each one has some "question" child nodes. So in each "view" node I need to create a tag in each "question" child node with a "name" text node.
So, from this...
XML:
<view name = "1st View">
<question>
<id>01</id>
<difficulty>easy</difficulty>
<name>user1</name>
<body>Question blah blah</body>
<date>
<date year="2008" month="5" day="17" hour="2" minute="31" second="11"/>
</date>
</question>
<question>
<id>02</id>
<difficulty>hard</difficulty>
<name>user2</name>
<body>Question blah blah</body>
<date>
<date year="2008" month="5" day="18" hour="2" minute="31" second="11"/>
</date>
</question>
</view>
...to this...
XML:
<view>
<question>
<name>1st View</name>
<id>01</id>
<difficulty>easy</difficulty>
<name>user1</name>
<body>Question blah blah</body>
<date>
<date year="2008" month="5" day="17" hour="2" minute="31" second="11"/>
</date>
</question>
<question>
<name>1st View</name>
<id>02</id>
<difficulty>hard</difficulty>
<name>user2</name>
<body>Question blah blah</body>
<date>
<date year="2008" month="5" day="18" hour="2" minute="31" second="11"/>
</date>
</question>
</view>
Hope somebody can help im really struggling with the XML DOM!
Thanks!