JoeMcGarvey
Programmer
Hi -
I have an XML doc structured as such:
I am accessing the DOM with ASP. I am passing a delete request for a particular node to the delete function through a URL variable. The URL variable is "file" with the value as the image name, ie:
delete.asp?file=image1.jpg
My delete function should find the "entity type='asset'" node and delete it.
Set objRoot = objXML.documentElement.firstChild.childNodes.item(3)
Set objNode = objRoot.SelectSingleNode("entity[File='" & file & "']"
objRoot.removeChild(objNode)
The above code works, but only when I request a delete from the first "entity type='folder'". I receive an error when I try to delete "image3.jpg" or "image4.jpg" because the function is looking for those images in the first folder, and does not find them.
I think my problem is in this line:
Set objRoot = objXML.documentElement.firstChild.childNodes.item(3)
How can I genericize this to look at all "entity type='folder'" nodes?
Thanks in advance!!
Joe
Joe McGarvey - Web Application Developer
Paragraph, Inc. - Paragraph Publisher -
I have an XML doc structured as such:
I am accessing the DOM with ASP. I am passing a delete request for a particular node to the delete function through a URL variable. The URL variable is "file" with the value as the image name, ie:
delete.asp?file=image1.jpg
My delete function should find the "entity type='asset'" node and delete it.
Set objRoot = objXML.documentElement.firstChild.childNodes.item(3)
Set objNode = objRoot.SelectSingleNode("entity[File='" & file & "']"
objRoot.removeChild(objNode)
The above code works, but only when I request a delete from the first "entity type='folder'". I receive an error when I try to delete "image3.jpg" or "image4.jpg" because the function is looking for those images in the first folder, and does not find them.
I think my problem is in this line:
Set objRoot = objXML.documentElement.firstChild.childNodes.item(3)
How can I genericize this to look at all "entity type='folder'" nodes?
Thanks in advance!!
Joe
Joe McGarvey - Web Application Developer
Paragraph, Inc. - Paragraph Publisher -