XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
John HigginsSubject: XML Output of stylesheet directive
Author: John Higgins
Date: 05 Dec 2005 08:55 AM
I am transforming XML to XML and trying to output a stylesheet directive (to perform a FO transform). I setup a variable with the directive using the predefined entities and value-of to output, as follows:
<xsl:variable name="trans_file">
&lt;?xml-stylesheet type=&quot;text/xsl&quot; href=&quot;c:\drv_e\brl\database\tools\FCI_Doc\item_fo.xsl&quot;?&gt;
</xsl:variable>
<xsl:value-of select="$trans_file"/>

The &quot; gets converted correctly, but the &lt; and &gt; are copied verbatim, as follows:
&lt;?xml-stylesheet type="text/xsl" href="c:\drv_e\brl\database\tools\FCI_Doc\item_fo.xsl"?&gt;

I have enclosed the XSL and output XML (the base item_spec.xml and boiler_plate.xml are unchanged from my previous posting.


Unknownitem_trans_1(1).xsl
XSL file

Unknownitem_doc.xml
Output XML

Postnext
Minollo I.Subject: XML Output of stylesheet directive
Author: Minollo I.
Date: 05 Dec 2005 09:29 AM
You should use something like (assuming you need to use a variable):

<xsl:variable name="trans_file">
<xsl:processing-instruction name="xml-stylesheet">type="text/xsl" href="c:\drv_e\brl\database\tools\FCI_Doc\item_fo.xsl"</xsl:processing-instruction>
</xsl:variable>
<xsl:copy-of select="$trans_file"/>

Minollo

Posttop
John HigginsSubject: XML Output of stylesheet directive
Author: John Higgins
Date: 05 Dec 2005 10:13 AM
Thanks again. It worked, and I didn't need to use a variable, I just needed to insert the processing-instruction.

John H

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.