Guest_imported
New member
- Jan 1, 1970
- 0
hi! please help me sort this out. badly urgent in need.
I am trying to delete a record on my XML file: the structure is here:
- <APPEND>
- <PACKAGE>
- <NEWPACKAGE id="7878">
<PID>7878</PID>
<ITEM>h</ITEM>
<DESCRIPTION>h</DESCRIPTION>
<VALUE>j</VALUE>
<HEIGHT>hj</HEIGHT>
<WEIGHT>j</WEIGHT>
<LENGTH>j</LENGTH>
<WIDTH>j</WIDTH>
<ARTICLES />
- <NEWARTICLE>
<ARTICLERANDID>343</ARTICLERANDID>
<SelectItemDesc>Ink</SelectItemDesc>
<ARTICLEQUANTITY>cgf</ARTICLEQUANTITY>
<ARTICLEUNITPRICE>d</ARTICLEUNITPRICE>
<ARTICLEINVOICE>df3</ARTICLEINVOICE>
<ArticleCopyID>7878</ArticleCopyID>
<ArticleCopyItem>h</ArticleCopyItem>
<xPACKAGEARTICLEID />
<xPACKAGEARTICLEDESCRIPTION />
<PACKAGEARTICLEID>7878</PACKAGEARTICLEID>
<PACKAGEARTICLEDESCRIPTION>h</PACKAGEARTICLEDESCRIPTION>
</NEWARTICLE>
</NEWPACKAGE>
</PACKAGE>
</APPEND>
I want to delete the record under NEWARTICLE specifically UNDER ARTICLERANDID=343.
And my code for the deletion is here:
set objXMLdelete = server.CreateObject("Microsoft.XMLDOM"
objXMLdelete.async = false
objXMLdelete.load strXMLFile
objXSLdelete.async = false
objXSLdelete.load strXSLFile
set objRootdelete = objXMLdelete.documentElement
set objNodedelete = objRootdelete.SelectSingleNode("PACKAGE[NEWPACKAGE[NEWARTICLE[ARTICLERANDID='"&mystrID&"']]]"
objRootdelete.removeChild(objNodedelete)
once i run this code: it removes all the records starting from NEWPACKAGE ... up to NEWARTICLES.
The thing is, i just want to delete the record under NEWARTICLES and data of PACKAGE should be retain.
Please help. tnx!
I am trying to delete a record on my XML file: the structure is here:
- <APPEND>
- <PACKAGE>
- <NEWPACKAGE id="7878">
<PID>7878</PID>
<ITEM>h</ITEM>
<DESCRIPTION>h</DESCRIPTION>
<VALUE>j</VALUE>
<HEIGHT>hj</HEIGHT>
<WEIGHT>j</WEIGHT>
<LENGTH>j</LENGTH>
<WIDTH>j</WIDTH>
<ARTICLES />
- <NEWARTICLE>
<ARTICLERANDID>343</ARTICLERANDID>
<SelectItemDesc>Ink</SelectItemDesc>
<ARTICLEQUANTITY>cgf</ARTICLEQUANTITY>
<ARTICLEUNITPRICE>d</ARTICLEUNITPRICE>
<ARTICLEINVOICE>df3</ARTICLEINVOICE>
<ArticleCopyID>7878</ArticleCopyID>
<ArticleCopyItem>h</ArticleCopyItem>
<xPACKAGEARTICLEID />
<xPACKAGEARTICLEDESCRIPTION />
<PACKAGEARTICLEID>7878</PACKAGEARTICLEID>
<PACKAGEARTICLEDESCRIPTION>h</PACKAGEARTICLEDESCRIPTION>
</NEWARTICLE>
</NEWPACKAGE>
</PACKAGE>
</APPEND>
I want to delete the record under NEWARTICLE specifically UNDER ARTICLERANDID=343.
And my code for the deletion is here:
set objXMLdelete = server.CreateObject("Microsoft.XMLDOM"
objXMLdelete.async = false
objXMLdelete.load strXMLFile
objXSLdelete.async = false
objXSLdelete.load strXSLFile
set objRootdelete = objXMLdelete.documentElement
set objNodedelete = objRootdelete.SelectSingleNode("PACKAGE[NEWPACKAGE[NEWARTICLE[ARTICLERANDID='"&mystrID&"']]]"
objRootdelete.removeChild(objNodedelete)
once i run this code: it removes all the records starting from NEWPACKAGE ... up to NEWARTICLES.
The thing is, i just want to delete the record under NEWARTICLES and data of PACKAGE should be retain.
Please help. tnx!