View Full Version : Serious Guy needed XML/ XSL help with ASP

Sep 17th, 2002, 04:43 AM
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?

Alex Vincent
Sep 17th, 2002, 05:04 AM
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. :)

Sep 18th, 2002, 06:23 AM
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?

Alex Vincent
Sep 18th, 2002, 09:11 PM
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.