[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] xsl:import overriding template rules
Hello, In my xsl stylesheets I use the xsl:import element a lot. The templates in the imported xsl files can be overridden by the templates in the xsl file which does the import. So far everything goes fine. I was assuming that this overriding rule, applies to templates with an equal matching pattern. An example: file aa.xsl file bb.xsl some templates of file aa.xsl are: <xsl:template match='*'> <root> <xsl:apply-templates match='elementA'/> </root> </xsl:template> <xsl:template match='*[local-name() = "SpecificElement"]'> <xsl:element name='{name()}'> <xsl:apply-templates match='@* | comment() | text()'/> </xsl:element> </xsl:template> file bb.xsl This file imports file aa.xsl <xsl:import href='aa.xsl'/> <xsl:template match='*'> <root> <xsl:template match='elementB'/> </root> </xsl:template> xsl:template match='*' in file bb.xsl, overrides the xsl:template match='*' in file aa.xsl. This is what I want and suspected. But.... it overrides also the xsl:template match='*[local-name() = "SpecificElement"]' in file aa.xsl. This is what I was not suspecting and also don't want. My question is, is it correct that the template xsl:template match='*[local-name() = "SpecificElement"]' in file aa.xsl, is overridden by the template match='*' if file bb.xsl. Regards, Boudewijn
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|