Re: "fake" added in nodesets (was Re: [xslt] Release of libxslt-1.0.5)



En réponse à Eric van der Vlist <vdv@dyomedea.com>:
> xslt:
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0"
> 	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> 	xmlns:exsl="http://exslt.org/common"
> 	extension-element-prefixes="exsl">
> 	<xsl:variable name="rtf"><test/></xsl:variable>
> 	<xsl:template match="/">
> 		<xsl:copy-of select="exsl:node-set($rtf)"/>
> 	</xsl:template >
> </xsl:stylesheet>
> 
> Result (with any source doc) using libxslt:
> <?xml version="1.0"?>
> <fake><test/></fake>
> 
> Result with Saxon:
> <?xml version="1.0" encoding="utf-8"?><test/>
> 
> This is obviously not at all the same result document (not even the same
> document type!).

A workaround is to use exslt:node-set($rtf)/node(). It should work everywhere.

Even with xsl:apply-templates, theere shouldn't be any difference comparing to 
using exslt:node-set($rtf), except of course if you have a template 
matching "fake" elements, or expected your RTF be matched by the template for 
the root node...

> Should this be considered as a bug?

Yes.

Tom.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]