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:
authorJason Diamond <injektilo@mono-cvs.ximian.com>2002-08-22 17:11:55 +0400
committerJason Diamond <injektilo@mono-cvs.ximian.com>2002-08-22 17:11:55 +0400
commit86ffcfbcd72febcdf6805025ac0e83b7343f3cea (patch)
treee83ad5e72dd29006ef5b7e7d96d3c1be0f2f7eaf /mcs/class/System.XML/Test/XmlDocumentTests.cs
parent2875f13d5a3feb78cc52ee62a934922f8d1ae1c1 (diff)
Added implementation of namepsace qualified GetElementsByTagName courtesy of
Matt Hunter <xrkune@tconl.com>. svn path=/trunk/mcs/; revision=6885
Diffstat (limited to 'mcs/class/System.XML/Test/XmlDocumentTests.cs')
-rw-r--r--mcs/class/System.XML/Test/XmlDocumentTests.cs23
1 files changed, 23 insertions, 0 deletions
diff --git a/mcs/class/System.XML/Test/XmlDocumentTests.cs b/mcs/class/System.XML/Test/XmlDocumentTests.cs
index 427cc70091d..5ede6bf749d 100644
--- a/mcs/class/System.XML/Test/XmlDocumentTests.cs
+++ b/mcs/class/System.XML/Test/XmlDocumentTests.cs
@@ -547,6 +547,29 @@ namespace MonoTests.System.Xml
AssertEquals ("GetElementsByTagName (string) returned incorrect count.", 4, bookList.Count);
}
+ public void TestGetElementsByTagNameUsingNameSpace ()
+ {
+ StringBuilder xml = new StringBuilder ();
+ xml.Append ("<?xml version=\"1.0\" ?><library xmlns:North=\"http://www.foo.com\"");
+ xml.Append ("xmlns:South=\"http://www.goo.com\"><North:book type=\"non-fiction\"> ");
+ xml.Append ("<North:title type=\"intro\">XML Fun</North:title> " );
+ xml.Append ("<North:author>John Doe</North:author> " );
+ xml.Append ("<North:price>34.95</North:price></North:book> " );
+ xml.Append ("<South:book type=\"fiction\"> " );
+ xml.Append ("<South:title>Bear and the Dragon</South:title> " );
+ xml.Append ("<South:author>Tom Clancy</South:author> " );
+ xml.Append ("<South:price>6.95</South:price></South:book> " );
+ xml.Append ("<South:book type=\"fiction\"><South:title>Bourne Identity</South:title> " );
+ xml.Append ("<South:author>Robert Ludlum</South:author> " );
+ xml.Append ("<South:price>9.95</South:price></South:book></library>");
+
+ MemoryStream memoryStream = new MemoryStream (Encoding.UTF8.GetBytes (xml.ToString ()));
+ document = new XmlDocument ();
+ document.Load (memoryStream);
+ XmlNodeList bookList = document.GetElementsByTagName ("book", "http://www.goo.com");
+ AssertEquals ("GetElementsByTagName (string, uri) returned incorrect count.", 2, bookList.Count);
+ }
+
public void TestInnerAndOuterXml ()
{