Include works like ordinary include :)

You may include one xslt file into another one using

<xsl:include href='file://myinclude.xsl'/>

This behaves like cut'n'paste, so all templates defined in included file 
may be accessed from template including the xsl:include declaration.

The only important limitation is, that xsl:include has to be a topmost 
element (child of xsl:stylesheet element).

Our favorite trick is to ude documents from internal arg:/ scheme passed 
to sablotron via named argument (see api and XML::Sablotron doc).

Pavel

Guillaume Rouchy wrote:

> Would you have some example of include a stylesheet into another one ?
> Alternatively could you tell me how it works ?
> The following doesn't seem to work :
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>   <xsl:include href="home.xsl"/>
> </xsl:stylesheet>
> 
> with home.xsl being a stylesheet like :
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> 
>   <xsl:template match="chapter">
>     <h2>A Title</h2>
>     <ul>
>       <xsl:apply-templates select="section"/>
>     </ul>
>   </xsl:template>
> 
>   <xsl:template match="section">
>     some section...
>   </xsl:template>
> 
> </xsl:stylesheet>
> 
> Thanks very much for your help
> 
> Guillaume


-- 
Pavel Hlavnicka
Ginger Alliance Ltd.
Prague; Czech Republic

Reply via email to