Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: xml/asp

  1. #1
    New Coder
    Join Date
    Sep 2002
    Thanked 0 Times in 0 Posts


    'Creating a NodeList of the elements in the XML Tree
    Set objNodeList = objDom.documentElement.childNodes

    'Loop through each item in the NodeList and check if its NodeType is that of a Processing Instruction i.e.

    for i = 0 to objNodeList.length

    Set objNode=objNodeList.item(i)
    If objNode.nodeType = 7 then

    set objNewPI = objDom.createProcessingInstruction("YourApp"," ")
    objNewPI.data = objNode.data

    objNode.parentNode.replaceChild objNewPI, objNode

    End If


    These is the script to modify the xml processing instructions. Its actually written in javascript but i've converted it to ASP and it can't work.

    In the asp file, whenever it runs till

    Set objNode=objNodeList.item(i) line, it has error occured. and thus i can't save my file.
    anybody can help....?

    original xml /javascript is
    <SCRIPT >

    /*Declaring memvars to be used later */
    var objDOM;
    var objNode;
    var objNodeList;
    var objNodeListEle;
    var i;
    var objNewPI;

    /* Instantiating the XML Parser */
    objDOM = new ActiveXObject("MSXML.DOMDocument");

    /*Opening the file nodename.xml inysc mode */
    objDOM.async = false;

    alert("ModProcInstr.xml loaded in memory")

    /*Creatubg a NodeList of the elements in the XML Tree */
    objNodeList = objDOM.documentElement.childNodes;

    /*Establishing and Displaying the number of elements in the XML tree in memory */
    objNodeListEle = objNodeList.length

    alert("The number of elements in the NodeList array is:" + objNodeListEle);

    /*Loop through each item in the NodeList and check if its NodeType is that of a Processing Instruction i.e. 7*/

    if(objNode.nodeType ==7)
    objNewPI = objDOM.createProcessingInstruction("YourApp"," ");
    objNewPI.data = objNode.data
    objNode.parentNode.replaceChild(objNewPI, objNode);
    alert("New Processing Instruction created");

  2. #2
    Join Date
    May 2002
    Hayward, CA
    Thanked 24 Times in 22 Posts

    Thumbs down

    Cross-posted and CLOSED:

    Please do not post the same question to two or more forums. It confuses people trying to help you and annoys moderators (like me).
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, ES7-Membrane project (Github Pages site)
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary


Posting Permissions

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