Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2002
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Editing Processing Line ????

    '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.

  • #2
    New to the CF scene
    Join Date
    Oct 2002
    Location
    Romania
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Mihaela.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •