Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtsushi Eno <atsushieno@gmail.com>2005-12-14 11:30:12 +0300
committerAtsushi Eno <atsushieno@gmail.com>2005-12-14 11:30:12 +0300
commit5392ed3dbb3fa737b91318b549a3635e408c7562 (patch)
treef3f3269434b9f97d62e2f9192b6e1f1e3f09ee07 /mcs/class/System.XML
parent36b7985e54a28abafa065eecad445ca0b40d002c (diff)
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
Diffstat (limited to 'mcs/class/System.XML')
-rw-r--r--mcs/class/System.XML/System.Xml/ChangeLog6
-rw-r--r--mcs/class/System.XML/System.Xml/XmlNode.cs17
2 files changed, 22 insertions, 1 deletions
diff --git a/mcs/class/System.XML/System.Xml/ChangeLog b/mcs/class/System.XML/System.Xml/ChangeLog
index 7cb98dba3d6..ec257fb8dba 100644
--- a/mcs/class/System.XML/System.Xml/ChangeLog
+++ b/mcs/class/System.XML/System.Xml/ChangeLog
@@ -1,5 +1,11 @@
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.
* XmlDocumentNavigator.cs : added 2.0 SchemaInfo.
diff --git a/mcs/class/System.XML/System.Xml/XmlNode.cs b/mcs/class/System.XML/System.Xml/XmlNode.cs
index ca0c42ed6f3..079ed7ca7aa 100644
--- a/mcs/class/System.XML/System.Xml/XmlNode.cs
+++ b/mcs/class/System.XML/System.Xml/XmlNode.cs
@@ -347,8 +347,14 @@ namespace System.Xml
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 @@ namespace System.Xml
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: