[Mono-bugs] [Bug 76530][Nor] Changed - Problem with null namespaces
using XSLT (testcase)
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Mon Oct 24 02:59:20 EDT 2005
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by atsushi at ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=76530
--- shadow/76530 2005-10-24 02:26:15.000000000 -0400
+++ shadow/76530.tmp.15521 2005-10-24 02:59:20.000000000 -0400
@@ -90,6 +90,45 @@
}
}
expected: <root xmlns="urn:foo" />
actual: <root />
+
+------- Additional Comments From atsushi at ximian.com 2005-10-24 02:59 -------
+Actually I have a fix for the simplified repro above, but not for this
+bug itself. Here is another repro. Replace "xsl" and "xml" in the
+above simplified repro with:
+
+ string xsl = @"<xsl:stylesheet version='1.0'
+ xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns='urn:foo'>
+ <xsl:template match='/*'>
+ <root>
+ <xsl:element name='{local-name()}' />
+ </root>
+ </xsl:template>
+</xsl:stylesheet>";
+
+ string xml = "<page/>";
+
+expected: <root xmlns="urn:foo"><page /></root>
+actual: <root xmlns="urn:foo"><page xmlns="" /></root>
+
+
+Index: Mono.Xml.Xsl/Compiler.cs
+===================================================================
+--- Mono.Xml.Xsl/Compiler.cs (revision 52109)
++++ Mono.Xml.Xsl/Compiler.cs (working copy)
+@@ -842,8 +842,9 @@
+ if (colon > 0)
+ return new QName (name.Substring (colon + 1), nsDecls
+[name.Substring (0, colon)] as string);
+ else if (colon < 0)
+- // Default namespace is not used for unprefixed names.
+- return new QName (name, "");
++ return new QName (name,
++ nsDecls.ContainsKey (String.Empty) ?
++ (string) nsDecls [String.Empty] : String.Empty);
+ else
+ throw new ArgumentException ("Invalid name: " + name);
+ }
+
More information about the mono-bugs
mailing list