In article <dH*********************@news-text.cableinet.net>,
Andy Fish <aj****@blueyonder.co.uk> wrote:
% the closest I can think of getting is to write template B including template
% A, and then put templates in B with the same "match" clause but with a
% higher priority than A. Unfortunately, a key feature would be to invoke the
xsl:import does this implicitly.
% superclass method as part of the overridden method, and I can't see any way
% to do this.
Once you've used xsl:import, you can invoke the template from the imported
stylesheet using xsl:apply-imports.
<!-- stylesheet A.xsl -->
<xsl:stylesheet version='1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:output method='text'/>
<xsl:template match='A'>
<xsl:text>standard processing of A.</xsl:text>
</xsl:template>
</xsl:stylesheet>
<!-- stylesheet B.xsl -->
<xsl:stylesheet version='1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<!-- this must come first! -->
<xsl:import href='A.xsl'/>
<xsl:template match='A'>
<xsl:text>Specialised processing of A, followed by </xsl:text>
<xsl:apply-imports/>
</xsl:template>
</xsl:stylesheet>
<!-- A.xml -->
<A/>
of course in the real world I would use names like x.xsl and y.xsl.
Anyway, if you process A.xml using A.xsl, you get this output
standard processing of A.
while if you process A.xml using B.xsl, you get this
Specialised processing of A, followed by standard processing of A.
--
Patrick TJ McPhee
East York Canada
pt**@interlog.com