View Single Post
  #1 (permalink)  
Old November 4th, 2004, 07:44 AM
Milan Milan is offline
Authorized User
 
Join Date: Sep 2004
Location: , , .
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Milan
Default Urgent Help:Deleting a node in xml using vb :

in vb
<book>
        <group> a
            <name>Group1</name>
            <bookname>
                <name>book1</name>
            </bookname>
            <bookname>
                <name>book2</name>
            </bookname>
        </group>
        <group> b
            <name>Group2</name>
            <bookname>
                <name>book3</name>
            </bookname>
            <bookname>
                <name>book4</name>
            </bookname>
        </group>
    </book>
so i needed to delete the node named group which has the text 'b'
delete full in between <group></group>
so
i used this coding in vb but
/////////////////////////////////
Set objnodelist = xmlDoc.getElementsByTagName("Group")

 For Each datenode In objnodelist
    If datenode.childNodes(0).Text = "a" Then
       root.removeChild (datenode)
     End If
 Next
////////////////////////////////
but getting an error in root.removechild where
object not support this method or propert

Reply With Quote