Permalink
Browse files

2005-12-14 Atsushi Enomoto <atsushi@ximian.com>

	* XmlNode.cs : under 2.0 xml/xmlns are treated as special cases in
	  GetNamespaceOfPrefix()/GetPrefixOfNamespace() (but it still does not
	  implement IXmlNamespaceResolver, bummer).


svn path=/trunk/mcs/; revision=54352
  • Loading branch information...
atsushieno committed Dec 14, 2005
1 parent 36b7985 commit 5392ed3dbb3fa737b91318b549a3635e408c7562
Showing with 22 additions and 1 deletion.
  1. +6 −0 mcs/class/System.XML/System.Xml/ChangeLog
  2. +16 −1 mcs/class/System.XML/System.Xml/XmlNode.cs
@@ -1,3 +1,9 @@
+2005-12-14 Atsushi Enomoto <atsushi@ximian.com>
+
+ * XmlNode.cs : under 2.0 xml/xmlns are treated as special cases in
+ GetNamespaceOfPrefix()/GetPrefixOfNamespace() (but it still does not
+ implement IXmlNamespaceResolver, bummer).
+
2005-12-14 Atsushi Enomoto <atsushi@ximian.com>
* XmlDocument.cs : changed some exception types.
@@ -347,8 +347,14 @@ public IEnumerator GetEnumerator ()
public virtual string GetNamespaceOfPrefix (string prefix)
{
- if (prefix == null)
+ switch (prefix) {
+ case null:
throw new ArgumentNullException ("prefix");
+ case "xml":
+ return XmlNamespaceManager.XmlnsXml;
+ case "xmlns":
+ return XmlNamespaceManager.XmlnsXmlns;
+ }
XmlNode node;
switch (NodeType) {
@@ -384,6 +390,15 @@ public virtual string GetNamespaceOfPrefix (string prefix)
public virtual string GetPrefixOfNamespace (string namespaceURI)
{
+#if NET_2_0
+ switch (namespaceURI) {
+ case XmlNamespaceManager.XmlnsXml:
+ return XmlNamespaceManager.PrefixXml;
+ case XmlNamespaceManager.XmlnsXmlns:
+ return XmlNamespaceManager.PrefixXmlns;
+ }
+#endif
+
XmlNode node;
switch (NodeType) {
case XmlNodeType.Attribute:

0 comments on commit 5392ed3

Please sign in to comment.