View Full Version : Serious Guy needed XML/ XSL help with ASP
09-17-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?
09-17-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. :)
09-18-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?
09-18-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.
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.