If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Setting root node

i have an xml document something like this:
<getlist><lists><list/><list/></lists></getlist>,
how do i make another xml document with <lists> as my root node(document
Element),can somebody help me out??

Re: Setting root node

"madhu" <maddie_maddie@hotmail.com> wrote:
>
>i have an xml document something like this:
><getlist><lists><list/><list/></lists></getlist>,
>how do i make another xml document with <lists> as my root node(document
>Element),can somebody help me out??
I had the same problem. There is no way to create a new dom directly.
In the next example domData would contain the values: <getlist><lists><list/><list/></lists></getlist>

Set ndNewDataNode = domData.childNodes(0)
For i = 0 To ndNewDataNode.childNodes.length - 1
Set ndClone = ndNewDataNode.childNodes(i).cloneNode(True)
If ndDataNode.selectSingleNode(ndClone.nodeName) Is nothing Then _
ndDataNode.appendChild ndClone
Next i