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 4 of 4
  1. #1
    New Coder
    Join Date
    Sep 2002
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Serious Guy needed XML/ XSL help with ASP

    Anybody has any idea how to edit
    <?xml-stylesheet type="text/xsl" href="rflooding.xsl"?>

    in a XML file with ASP ? I've read on editing the XML elements and their nodes, but not the line above. Anyidea how to edit the part in bold so that i can change the value of the href="rflooding.xsl" with my html form?

  • #2
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,461
    Thanks
    1
    Thanked 23 Times in 21 Posts
    XML PI's (which is almost what this is) have two properties: target and data. For instance,

    <?php echo("Hello World") ?>

    The target is "php" and the data is 'echo("Hello World") '. Note the final space at the end of the data string.

    Mozilla and Netscape don't themselves always expose <?xml-stylesheet ?>, particularly when the type pseudo-attribute equals "text/xsl". So be aware of that.

    As for ASP itself... I'm clueless there.
    "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, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog

  • #3
    New Coder
    Join Date
    Sep 2002
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Found out!

    Hi, I've found out myself using this method in ASP


    Set objPII = objDom.createProcessingInstruction("xml-stylesheet", "type='text/xsl' href='aflooding.xsl'")

    objDom.insertBefore objPII, objDom.childNodes(0)

    However, The output in the updated XML was

    <?xml-stylesheet type='text/xsl' href='aflooding.xsl'?>

    notice that it is using a ' instead of a " , although it still can work, i wonder if i'm using the correct way to do it?

  • #4
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,461
    Thanks
    1
    Thanked 23 Times in 21 Posts
    That's perfectly fine. Attributes (and pseudo-attributes for that particular pseudo-PI) can have their values enclosed in single quotes or double quotes. But mismatched quotes aren't valid.
    "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, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog


  •  

    Posting Permissions

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