[xsl] referencing a stylesheet within xsl:document

Subject: [xsl] referencing a stylesheet within xsl:document
From: "Shawn O. McKenzie" <smckenzie@xxxxxxxxxxx>
Date: Tue, 17 Dec 2002 17:16:46 -0800
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