...

Editing Processing Line ????

flyclassic
09-19-2002, 02:19 AM
'Create the xml processing instruction.
Set objPI = objDom.createProcessingInstruction("xml-stylesheet",
"type='text/xsl' href='aflooding.xsl'")


How do i detect if the line <?xml-
stylesheet type='text/xsl' href='aflooding.xsl'?>
existed before i can write this line to the xml file again?
Any particular line to use to check? If not how do i del a processing line? any idea??
Any Idea? Your help will be greatly Appreciated.

Mihaela
10-01-2002, 12:42 PM
Try this code:

var obj = Server.CreateObject("Microsoft.XMLDOM")
obj.load(Server.MapPath("test.xml"))

if (obj.childNodes[0].nodeName == "xml-stylesheet" && obj.childNodes[0].nodeValue == "type='text/xsl' href='aflooding.xsl'") {
Response.write("The first child node of the document is this processin instruction:<BR>")
Response.write("&lt;?" + obj.childNodes[0].nodeName + " " + obj.childNodes[0].nodeValue + "?&gt;")
}

obj = null


Here I check if the first child node of the document is <?xml-stylesheet type='text/xsl' href='aflooding.xsl'?> processing instruction.

Hope this helps.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum