[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: referencing a stylesheet within xsl:document

Subject: Re: referencing a stylesheet within xsl:document
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Wed, 18 Dec 2002 03:24:55 +0100
xsl document method
Hello Shawn,

you have 2 problems:

1. xsl:document is not part of XSLT 1.0, only of XSLT 1.1, which is no longer developed (http://www.w3.org/TR/xslt11/). You won't find any XSLT processors, that know XSLT 1.1. The only one I know is Saxon in some versions.
Alternative for XSLT 1.0 are different processor specific extension functions like Xalan redirect.


2. <?xml-stylesheet type="text/xsl" href="../display.xsl"?>
That's a processing instruction. If you write it in this way in your XSLT, it's used (or not) there and not in the output. To create one in the result tree, use
<xsl:processing-instruction name="xml-stylesheet">type="text/xsl" href="../display.xsl"</xsl:processing-instruction>.


Regards,

Joerg

Shawn O. McKenzie wrote:
I am splitting multiple xml documents into smaller files using xsl:document. Each of the output files needs to include a reference to another transform to display in a browser. What I would like to do is someting like:

<xsl:for-each select="namespace/class">
<xsl:variable name="class" select="@name"/>
<xsl:variable name="file" select="concat($namespace, '.', $class, '.xml')"/>



<xsl:document method="xml" href="{$file}"> <?xml-stylesheet type="text/xsl" href="../display.xsl"?>

       <class><xsl:copy-of select="@name"/>
         <xsl:call-template name="hierarchy"/>
         <xsl:call-template name="mergefiles"/>
       </class>

   </xsl:document>
 </xsl:for-each>


However, it does not pick up the <?xml-stylesheet type="text/xsl" href="../display.xsl"?> line. I tried putting this content within an xsl:text element but that complained about the content of the element. I also tried changing < and > to their related entity refs, but that just pulled in the entity refs.


It would seem that you should be able to do this in one of the attributes of xsl:document, but I'm not seeing it.


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.