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
path: root/mcs
diff options
context:
space:
mode:
authorJason Diamond <injektilo@mono-cvs.ximian.com>2002-08-23 07:26:57 +0400
committerJason Diamond <injektilo@mono-cvs.ximian.com>2002-08-23 07:26:57 +0400
commitf9553b038a2240bbb2e6d081165b7cd485b1d7de (patch)
tree439ccbd684dee5e75857ffe988c841e4a5b405ea /mcs
parentc987ba086d5d2aadb9cf6e5e3e300234195b1785 (diff)
Correction to previous GetElementsByTagName patch courtesy of Matt Hunter <xrkune@tconl.com>.
svn path=/trunk/mcs/; revision=6920
Diffstat (limited to 'mcs')
-rw-r--r--mcs/class/System.XML/System.Xml/ChangeLog5
-rw-r--r--mcs/class/System.XML/System.Xml/XmlElement.cs7
-rw-r--r--mcs/class/System.XML/Test/ChangeLog5
-rw-r--r--mcs/class/System.XML/Test/XmlElementTests.cs10
4 files changed, 25 insertions, 2 deletions
diff --git a/mcs/class/System.XML/System.Xml/ChangeLog b/mcs/class/System.XML/System.Xml/ChangeLog
index 3f2769fbbdd..bb2e2a8ab7d 100644
--- a/mcs/class/System.XML/System.Xml/ChangeLog
+++ b/mcs/class/System.XML/System.Xml/ChangeLog
@@ -1,5 +1,10 @@
2002-08-22 Jason Diamond <jason@injektilo.org>
+ * XmlElement.cs: Correction to previous GetElementsByTagName patch
+ courtesy of Matt Hunter <xrkune@tconl.com>.
+
+2002-08-22 Jason Diamond <jason@injektilo.org>
+
* XmlDocument.cs, XmlElement.cs: Added implementation of namepsace
qualified GetElementsByTagName courtesy of Matt Hunter
<xrkune@tconl.com>.
diff --git a/mcs/class/System.XML/System.Xml/XmlElement.cs b/mcs/class/System.XML/System.Xml/XmlElement.cs
index be669c5fc74..11802a285ac 100644
--- a/mcs/class/System.XML/System.Xml/XmlElement.cs
+++ b/mcs/class/System.XML/System.Xml/XmlElement.cs
@@ -187,6 +187,13 @@ namespace System.Xml
}
}
+ public virtual XmlNodeList GetElementsByTagName (string localName, string namespaceURI)
+ {
+ ArrayList nodeArrayList = new ArrayList ();
+ this.searchNodesRecursively (this, localName, namespaceURI, nodeArrayList);
+ return new XmlNodeArrayList (nodeArrayList);
+ }
+
[MonoTODO]
public virtual bool HasAttribute (string name)
{
diff --git a/mcs/class/System.XML/Test/ChangeLog b/mcs/class/System.XML/Test/ChangeLog
index a3d4249efcd..86707218b62 100644
--- a/mcs/class/System.XML/Test/ChangeLog
+++ b/mcs/class/System.XML/Test/ChangeLog
@@ -1,5 +1,10 @@
2002-08-22 Jason Diamond <jason@injektilo.org>
+ * XmlElementTests.cs: Correction to previous GetElementsByTagName
+ patch courtesy of Matt Hunter <xrkune@tconl.com>.
+
+2002-08-22 Jason Diamond <jason@injektilo.org>
+
* XmlDocumentTests.cs, XmlElementTests.cs: Added tests for
namespace qualified GetElementsByTagName courtesy of Matt Hunter
<xrkune@tconl.com>.
diff --git a/mcs/class/System.XML/Test/XmlElementTests.cs b/mcs/class/System.XML/Test/XmlElementTests.cs
index 734b36108dd..a8561f39373 100644
--- a/mcs/class/System.XML/Test/XmlElementTests.cs
+++ b/mcs/class/System.XML/Test/XmlElementTests.cs
@@ -150,7 +150,10 @@ namespace MonoTests.System.Xml
MemoryStream memoryStream = new MemoryStream (Encoding.UTF8.GetBytes (xml));
document = new XmlDocument ();
document.Load (memoryStream);
- XmlNodeList bookList = document.GetElementsByTagName ("book");
+ XmlNodeList libraryList = document.GetElementsByTagName ("library");
+ XmlNode xmlNode = libraryList.Item (0);
+ XmlElement xmlElement = xmlNode as XmlElement;
+ XmlNodeList bookList = xmlElement.GetElementsByTagName ("book");
AssertEquals ("GetElementsByTagName (string) returned incorrect count.", 4, bookList.Count);
}
@@ -173,7 +176,10 @@ namespace MonoTests.System.Xml
MemoryStream memoryStream = new MemoryStream (Encoding.UTF8.GetBytes (xml.ToString ()));
document = new XmlDocument ();
document.Load (memoryStream);
- XmlNodeList bookList = document.GetElementsByTagName ("book", "http://www.foo.com");
+ XmlNodeList libraryList = document.GetElementsByTagName ("library");
+ XmlNode xmlNode = libraryList.Item (0);
+ XmlElement xmlElement = xmlNode as XmlElement;
+ XmlNodeList bookList = xmlElement.GetElementsByTagName ("book", "http://www.foo.com");
AssertEquals ("GetElementsByTagName (string, uri) returned incorrect count.", 1, bookList.Count);
}