[Mono-bugs] [Bug 352551] New: XSLT <copy-of /> element in XslTransform/ XslCompiledTransform results in the selected node' s children being inserted into the output document instead of the complete node (and its children) itself
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Tue Jan 8 21:54:54 EST 2008
https://bugzilla.novell.com/show_bug.cgi?id=352551
Summary: XSLT <copy-of /> element in
XslTransform/XslCompiledTransform results in the
selected node's children being inserted into the output
document instead of the complete node (and its children)
itself
Product: Mono: Class Libraries
Version: 1.2.5
Platform: All
OS/Version: All
Status: NEW
Severity: Major
Priority: P5 - None
Component: Sys.XML
AssignedTo: atsushi at ximian.com
ReportedBy: rcook at opiumtrail.com
QAContact: mono-bugs at ximian.com
Found By: Development
Created an attachment (id=189842)
--> (https://bugzilla.novell.com/attachment.cgi?id=189842)
Source code and XML demonstrating bug
According to the W3 spec (http://www.w3.org/TR/xslt#copy-of) the "copy-of"
element should copy an entire node or node set into the result when the result
of the expression in the "select" attribute evaluates to a node or a node set.
The .NET Class Library implementation of the XslTransform and
XslCompiledTransform do this correctly while Mono's implementation does not:
instead it outputs the children of the XML node or node set to the output.
I have attached a small application to repro this behaviour. It contains a
simple XSLT transform "transform.xml" which calls a custom function through the
"select" attribute which returns an XmlNode instance (the DocumentElement
property of an XmlDocument instance).
The transform looks like:
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:foo="urn:Foo">
<xsl:template match="/">
<xsl:copy-of select="foo:MyCustomFunction()"/>
</xsl:template>
</xsl:stylesheet>
The input XML looks like:
<family>
<person>
<given-name age="10">
<name>Fred</name>
<nick-name>Freddy</nick-name>
</given-name>
<family-name>Smith</family-name>
</person>
<person>
<given-name age="10">
<name>Robert</name>
<nick-name>Bob</nick-name>
</given-name>
<family-name>Smith</family-name>
</person>
</family>
The .NET implementation yields the correct output:
<?xml version="1.0" encoding="utf-8"?><root><child0 /><child1 /></root>
The Mono implementation yields the incorrect output:
<?xml version="1.0" encoding="utf-8"?><child0 /><child1 />
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
More information about the mono-bugs
mailing list