removing all children from an XML node

X

xargon

Hi everyone,

I am using VBA for MS office. I would like to know how I can delete all
children of a node. The method should not fail if the node has no
children.

So, basically I have:

Dim xmlParser as Object
Set xmlParser = CreateObject("MSXML2.DOMDocument")
xmlParser.LoadXML (documentXMLData)
Dim serializedElment as Object
Set serializedElement =
xmlParser.ChildNodes(0).selectSingleNode("SerializedData")

Now I want to delete all children (if any) of the serializedElement node.

How can I do this?

Thanx!

Xargon
 
C

Cindy M -WordMVP-

Hi Xargon,

Give us some sample data so that we can see what we're dealing with,
please?
I am using VBA for MS office. I would like to know how I can delete all
children of a node. The method should not fail if the node has no
children.

So, basically I have:

Dim xmlParser as Object
Set xmlParser = CreateObject("MSXML2.DOMDocument")
xmlParser.LoadXML (documentXMLData)
Dim serializedElment as Object
Set serializedElement =
xmlParser.ChildNodes(0).selectSingleNode("SerializedData")

Now I want to delete all children (if any) of the serializedElement node.

How can I do this?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top