Subject: Re: [xsl] stylesheet organisation From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Sat, 03 Sep 2011 10:16:40 -0400 |
t:\ftemp>type doc.xml <doc/>
t:\ftemp> t:\ftemp>type A.xsl <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/" priority="1000"> Stylesheet A </xsl:template>
</xsl:stylesheet> t:\ftemp> t:\ftemp>type B.xsl <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/" priority="1"> Stylesheet B </xsl:template>
</xsl:stylesheet> t:\ftemp> t:\ftemp>type C.xsl <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/" priority="1"> Stylesheet C </xsl:template>
</xsl:stylesheet> t:\ftemp> t:\ftemp>xslt doc.xml B.xsl con <?xml version="1.0" encoding="utf-8"?> Stylesheet A
t:\ftemp> t:\ftemp>xslt doc.xml C.xsl con <?xml version="1.0" encoding="utf-8"?> Stylesheet C
In my haste I described my two examples in the text backwards: in fact B.xsl includes A.xsl and C.xsl imports A.xsl. The template rule in B.xsl is overridden by match priority by the template rule in A.xsl. The template rule in C.xsl overrides by import precedence the template rule in A.xsl.
The stylesheet fragments are still correct illustrating the difference between import and include, I just wrote the description of the example incorrectly.
Please forgive my oversight due to my haste.
. . . . . . . . Ken
-- Contact us for world-wide XML consulting & instructor-led training Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Legal business disclaimers: http://www.CraneSoftwrights.com/legal
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] stylesheet organisation, G. Ken Holman | Thread | Re: [xsl] stylesheet organisation, Andrew Welch |
Re: [xsl] stylesheet organisation, Andrew Welch | Date | Re: [xsl] stylesheet organisation, Michael Kay |
Month |