Delete item from xml???

Can anybody plz tell me how to delete JUSt an item from the xml
it should be like this:

--------------------------------
strID = Request.Form("txtID")

Set objXML = Server.CreateObject("Microsoft.XMLDOM")
objXML.Load(Server.MapPath("File.xml"))

Set objLst = objXML.getElementsByTagName("ID")

Set subLst = objLst.item(strID)

** START DELETE THE ITEM WHERE IT'S ID IS strID **
Next
--------------------------------

Comments

  • : Can anybody plz tell me how to delete JUSt an item from the xml
    : it should be like this:
    :
    : --------------------------------
    : strID = Request.Form("txtID")
    :
    : Set objXML = Server.CreateObject("Microsoft.XMLDOM")
    : objXML.Load(Server.MapPath("File.xml"))
    :
    : Set objLst = objXML.getElementsByTagName("ID")
    :
    : Set subLst = objLst.item(strID)
    :
    : ** START DELETE THE ITEM WHERE IT'S ID IS strID **
    : Next
    : --------------------------------

    Try the removeChild(childnode) method. Of course you would want to call it on the parent of the node you're trying to remove.


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion