Subject: [xsl] Mixing imports and includes - specified behaviour? From: mazerunner@xxxxxx Date: Sun, 29 Jan 2006 02:01:55 +0100 (MET) |
Hi there, in this example I found different result from different XSLT processors, just call main.xsl with input '<one/>': main.xsl : <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:include href="first.xsl"/> <xsl:include href="second.xsl"/> <xsl:template match="/"> <b> <xsl:for-each select="one | two | three | four"> <xsl:apply-templates select="."/> </xsl:for-each> </b> </xsl:template> </xsl:stylesheet> first.xsl : <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:template match="one"> <xsl:apply-imports/> <xsl:text>1</xsl:text> </xsl:template> <xsl:template match="two"> <xsl:text>2</xsl:text> </xsl:template> </xsl:stylesheet> second.xsl : <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:import href="third.xsl"/> <xsl:template match="three"> <xsl:text>3</xsl:text> </xsl:template> <xsl:template match="four"> <xsl:text>4</xsl:text> </xsl:template> </xsl:stylesheet> third.xsl : <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:template match="one"> <xsl:text>this is also one</xsl:text> </xsl:template> </xsl:stylesheet> And this is how it works: In main.xsl I include two stylesheets. In one stylesheet I import a template that is activated in the other. I have following question: Is the result defined in XSLT 1.0 and XSLT 2.0? Thanks in advance Tobias
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Selecting attribute from , Jay Bryant | Thread | RE: [xsl] Mixing imports and includ, Michael Kay |
RE: [xsl] Shallow copy and base URI, Michael Kay | Date | Re: [xsl] Accessing external variab, viniciuscamara |
Month |