[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Inconsistent interpretation of // relative to document
I get different results when using Saxon to merge two documents, depending on whether I invoke Saxon via Ant or via JAXP. The difference appears to be how "//" is interpreted while processing nodes obtained using document(). The Ant version finds nodes in the source document (as opposed to the one obtained via the function). The JAXP version finds nodes among those returned by the document function. Which is the correct behaviour? (Also, is there a name for "//"?) I am using Saxon-8.9B, Sun JDK 1.6, XSLT 2. My stylesheet is below. Regards Richard Hoberman <xsl:stylesheet version="2.0" xmlns="http://www.w3.org/1999/XSL/Format" xmlns:c="http://www.sadalbari.com/2007/FO/Composition" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:param name="template-source" /> <xsl:variable name="template" select="document($template-source)/*" /> <xsl:template match="c:composition"> <xsl:apply-templates select="$template" mode="insert" /> </xsl:template> <xsl:template match="c:insert" mode="insert"> <xsl:variable name="name" select="@name" /> <xsl:apply-templates select="//c:define[@name=$name]/node()" mode="insert" /> </xsl:template> <xsl:template match="@*|node()" mode="insert"> <xsl:copy> <xsl:apply-templates select="@*|node()" mode="insert" /> </xsl:copy> </xsl:template> <xsl:template match="@*|node()" mode="copy"> <xsl:copy> <xsl:apply-templates select="@*|node()" mode="copy" /> </xsl:copy> </xsl:template> <xsl:template match="*" /> </xsl:stylesheet>
|
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
|