Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - statically embedding a stylesheet within another stylesheet >Thread Next - Re: statically embedding a stylesheet within another stylesheet Re: statically embedding a stylesheet within another stylesheetTo: NULL Date: 2/3/2006 8:15:00 PM On 3 Feb 2006 05:11:01 -0800, "hq4000@h..."
<hq4000@h...> wrote:
>Given AStyleSheet.xsl :
>
><AStyleSheet>
><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
>xmlns="http://www.mytest.mytest2.mytest3.com"version="1.0">
> <xsl:output method="xml" indent="yes"/>
> <xsl:template match="/">
> <xsl:element name="Test">it works</xsl:element>
> </xsl:template>
> </xsl:stylesheet>
></AStyleSheet>
>
>I am trying to embedding the style sheet within another style sheet as
>below. If I am using <xsl:copy-of
>select="document('AStyleSheet.xsl')"/>, it works ok. But I am having
>trouble doing the static embedding of the style sheet as below. Any
>idea how to allow static embedding?
Would it be better to use xsl:include or xsl:import instead ?
http://www.w3schools.com/xsl/el_include.asp
http://www.w3schools.com/xsl/el_import.asp
There are also ways to define what to do in the event of clashing
templates (precedence) using these functions, which are native to XSLT
><?xml version="1.0" encoding="UTF-8" ?>
><xsl:stylesheet version="1.0"
>xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
><xsl:output method="xml" indent="yes"/>
><xsl:template match="/">
><Root>
> <Data>test stylesheet embedding</Data>
> <!--dynamic embedding works:
> <xsl:copy-of select="document('AStyleSheet.xsl')"/>
> -->
> <!--static embedding not working -->
> <AStyleSheet>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
>xmlns="http://www.mytest.mytest2.mytest3.com"version="1.0">
> <xsl:output method="xml" indent="yes"/>
> <xsl:template match="/">
> <xsl:element name="Test">it works</xsl:element>
> </xsl:template>
> </xsl:stylesheet>
> </AStyleSheet>
></Root>
></xsl:template>
></xsl:stylesheet>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
