diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2004-05-13 18:21:58 +0400 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2004-05-13 18:21:58 +0400 |
commit | bb254c546c704d02113bcbbbe34f14e97f2547a4 (patch) | |
tree | e1fbe66fcbfbb8c6c979ec228fdbec7c4fd44ef1 /mcs/class/System.Security/Mono.Xml | |
parent | 87223a0b938159d5ebcb29ea577421f070c1bc3a (diff) |
2004-05-13 Atsushi Enomoto <atsushi@ximian.com>
* XmlCanonicalizer.cs :
Element namespace is not XPath-selected(selectable) namespace nodes
and that should be outputted.
Don't return null for empty output.
svn path=/trunk/mcs/; revision=27270
Diffstat (limited to 'mcs/class/System.Security/Mono.Xml')
-rwxr-xr-x | mcs/class/System.Security/Mono.Xml/ChangeLog | 7 | ||||
-rwxr-xr-x | mcs/class/System.Security/Mono.Xml/XmlCanonicalizer.cs | 12 |
2 files changed, 18 insertions, 1 deletions
diff --git a/mcs/class/System.Security/Mono.Xml/ChangeLog b/mcs/class/System.Security/Mono.Xml/ChangeLog index 4ab97a3aaa2..c90ebd1ea41 100755 --- a/mcs/class/System.Security/Mono.Xml/ChangeLog +++ b/mcs/class/System.Security/Mono.Xml/ChangeLog @@ -1,3 +1,10 @@ +2004-05-13 Atsushi Enomoto <atsushi@ximian.com> + + * XmlCanonicalizer.cs : + Element namespace is not XPath-selected(selectable) namespace nodes + and that should be outputted. + Don't return null for empty output. + 2004-03-26 Atsushi Enomoto <atsushi@ximian.com> * XmlCanonicalizer.cs : diff --git a/mcs/class/System.Security/Mono.Xml/XmlCanonicalizer.cs b/mcs/class/System.Security/Mono.Xml/XmlCanonicalizer.cs index b4ca937657a..c07f7f4007e 100755 --- a/mcs/class/System.Security/Mono.Xml/XmlCanonicalizer.cs +++ b/mcs/class/System.Security/Mono.Xml/XmlCanonicalizer.cs @@ -62,7 +62,7 @@ namespace Mono.Xml { { xnl = nodes; if (nodes == null || nodes.Count < 1) - return null; + return new MemoryStream (); return Canonicalize (nodes[0].OwnerDocument); } @@ -242,6 +242,16 @@ namespace Mono.Xml { has_empty_namespace = true; } } + // Do element ns check + if (visible && !IsNamespaceRendered (node.Prefix, node.NamespaceURI)) { + if (node.Prefix != String.Empty) { + // hack hack ;-) + XmlAttribute attr = node.OwnerDocument.CreateAttribute ("xmlns", node.Prefix, "http://www.w3.org/2000/xmlns/"); + attr.Value = node.NamespaceURI; + list.Add (attr); + } else if (!has_empty_namespace) + res.Append (" xmlns=\"" + node.NamespaceURI + "\""); + } // add empty namespace if needed if (visible && !has_empty_namespace && !IsNamespaceRendered (string.Empty, string.Empty)) |