Skip to content

Commit

Permalink
2005-12-14 Atsushi Enomoto <atsushi@ximian.com>
Browse files Browse the repository at this point in the history
	* XPathNavigator.cs : Added MonoTODO to CreateAttributes(). Removed
	  MonoTODO from ReadSubtree().

	* XPathNavigatorReaderTests.cs : Actually AttributesAndNamespaces()
	  does not work under MS.NET.


svn path=/trunk/mcs/; revision=54366
  • Loading branch information
atsushieno committed Dec 14, 2005
1 parent d6003e9 commit 0afa9b2
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 41 deletions.
5 changes: 5 additions & 0 deletions mcs/class/System.XML/System.Xml.XPath/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2005-12-14 Atsushi Enomoto <atsushi@ximian.com>

* XPathNavigator.cs : Added MonoTODO to CreateAttributes(). Removed
MonoTODO from ReadSubtree().

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

* XPathNavigator.cs : UnderlyingObject returns null by default.
Expand Down
2 changes: 1 addition & 1 deletion mcs/class/System.XML/System.Xml.XPath/XPathNavigator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,6 @@ public virtual bool MoveToFollowing (XPathNodeType type,
} while (true);
}

[MonoTODO]
public virtual XmlReader ReadSubtree ()
{
return new XPathNavigatorReader (this);
Expand Down Expand Up @@ -1055,6 +1054,7 @@ public virtual void CreateAttribute (string prefix, string localName, string nam
}

// must override it.
[MonoTODO ("needs tests")]
public virtual XmlWriter CreateAttributes ()
{
throw new NotSupportedException ();
Expand Down
5 changes: 5 additions & 0 deletions mcs/class/System.XML/Test/System.Xml.XPath/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2005-12-14 Atsushi Enomoto <atsushi@ximian.com>

* XPathNavigatorReaderTests.cs : Actually AttributesAndNamespaces()
does not work under MS.NET.

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

* XPathNavigatorReaderTests.cs : new file for testing ReadSubtree()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ void FromChildElement (XPathNavigator nav, string label)
}

[Test]
[Category ("NotDotNet")] // MS bug
public void AttributesAndNamespaces ()
{
string xml = "<root attr='value' x:a2='v2' xmlns:x='urn:foo' xmlns='urn:default'></root>";
Expand Down Expand Up @@ -381,93 +382,93 @@ void AttributesAndNamespaces (XPathNavigator nav, string label)
// Value, HasValue, AttributeCount, HasAttributes
String.Empty, false, 4, true);

// Attributes
// Namespaces

Assert.IsTrue (r.MoveToAttribute ("attr"), label + "#14");
XmlAssert.AssertNode (label + "#15", r,
Assert.IsTrue (r.MoveToAttribute ("xmlns:x"), label + "#4");
XmlAssert.AssertNode (label + "#5", r,
// NodeType, Depth, IsEmptyElement
XmlNodeType.Attribute, 1, false,
// Name, Prefix, LocalName, NamespaceURI
"attr", String.Empty, "attr", String.Empty,
"xmlns:x", "xmlns", "x",
"http://www.w3.org/2000/xmlns/",
// Value, HasValue, AttributeCount, HasAttributes
"value", true, 4, true);
"urn:foo", true, 4, true);

Assert.IsTrue (r.ReadAttributeValue (), label + "#16");
XmlAssert.AssertNode (label + "#17", r,
Assert.IsTrue (r.ReadAttributeValue (), label + "#6");
///* MS.NET has a bug here
XmlAssert.AssertNode (label + "#7", r,
// NodeType, Depth, IsEmptyElement
XmlNodeType.Text, 2, false,
// Name, Prefix, LocalName, NamespaceURI
String.Empty, String.Empty, String.Empty, String.Empty,
// Value, HasValue, AttributeCount, HasAttributes
"value", true, 4, true);
"urn:foo", true, 4, true);
//*/

Assert.IsFalse (r.ReadAttributeValue (), label + "#18");
Assert.IsFalse (r.ReadAttributeValue (), label + "#8");

Assert.IsTrue (r.MoveToAttribute ("x:a2"), label + "#19");
XmlAssert.AssertNode (label + "#20", r,
Assert.IsTrue (r.MoveToAttribute ("xmlns"), label + "#9");
XmlAssert.AssertNode (label + "#10", r,
// NodeType, Depth, IsEmptyElement
XmlNodeType.Attribute, 1, false,
// Name, Prefix, LocalName, NamespaceURI
"x:a2", "x", "a2", "urn:foo",
"xmlns", String.Empty, "xmlns",
"http://www.w3.org/2000/xmlns/",
// Value, HasValue, AttributeCount, HasAttributes
"v2", true, 4, true);
"urn:default", true, 4, true);

Assert.IsTrue (r.ReadAttributeValue (), label + "#21");
XmlAssert.AssertNode (label + "#22", r,
Assert.IsTrue (r.ReadAttributeValue (), label + "#11");
///* MS.NET has a bug here
XmlAssert.AssertNode (label + "#12", r,
// NodeType, Depth, IsEmptyElement
XmlNodeType.Text, 2, false,
// Name, Prefix, LocalName, NamespaceURI
String.Empty, String.Empty, String.Empty, String.Empty,
// Value, HasValue, AttributeCount, HasAttributes
"v2", true, 4, true);
"urn:default", true, 4, true);
//*/

// Namespaces
Assert.IsFalse (r.ReadAttributeValue (), label + "#13");

Assert.IsTrue (r.MoveToAttribute ("xmlns"), label + "#9");
XmlAssert.AssertNode (label + "#10", r,
// Attributes

Assert.IsTrue (r.MoveToAttribute ("attr"), label + "#14");
XmlAssert.AssertNode (label + "#15", r,
// NodeType, Depth, IsEmptyElement
XmlNodeType.Attribute, 1, false,
// Name, Prefix, LocalName, NamespaceURI
"xmlns", String.Empty, "xmlns",
"http://www.w3.org/2000/xmlns/",
"attr", String.Empty, "attr", String.Empty,
// Value, HasValue, AttributeCount, HasAttributes
"urn:default", true, 4, true);
"value", true, 4, true);

Assert.IsTrue (r.ReadAttributeValue (), label + "#11");
//* here too
XmlAssert.AssertNode (label + "#12", r,
Assert.IsTrue (r.ReadAttributeValue (), label + "#16");
XmlAssert.AssertNode (label + "#17", r,
// NodeType, Depth, IsEmptyElement
XmlNodeType.Text, 2, false,
// Name, Prefix, LocalName, NamespaceURI
String.Empty, String.Empty, String.Empty, String.Empty,
// Value, HasValue, AttributeCount, HasAttributes
"urn:default", true, 4, true);
//*/
"value", true, 4, true);

Assert.IsFalse (r.ReadAttributeValue (), label + "#13");
Assert.IsFalse (r.ReadAttributeValue (), label + "#18");

Assert.IsTrue (r.MoveToAttribute ("xmlns:x"), label + "#4");
XmlAssert.AssertNode (label + "#5", r,
Assert.IsTrue (r.MoveToAttribute ("x:a2"), label + "#19");
XmlAssert.AssertNode (label + "#20", r,
// NodeType, Depth, IsEmptyElement
XmlNodeType.Attribute, 1, false,
// Name, Prefix, LocalName, NamespaceURI
"xmlns:x", "xmlns", "x",
"http://www.w3.org/2000/xmlns/",
"x:a2", "x", "a2", "urn:foo",
// Value, HasValue, AttributeCount, HasAttributes
"urn:foo", true, 4, true);
"v2", true, 4, true);

Assert.IsTrue (r.ReadAttributeValue (), label + "#6");
///* temporarily comment out since MS.NET has a bug here
XmlAssert.AssertNode (label + "#7", r,
Assert.IsTrue (r.ReadAttributeValue (), label + "#21");
XmlAssert.AssertNode (label + "#22", r,
// NodeType, Depth, IsEmptyElement
XmlNodeType.Text, 2, false,
// Name, Prefix, LocalName, NamespaceURI
String.Empty, String.Empty, String.Empty, String.Empty,
// Value, HasValue, AttributeCount, HasAttributes
"urn:foo", true, 4, true);
//*/

Assert.IsFalse (r.ReadAttributeValue (), label + "#8");
"v2", true, 4, true);

Assert.IsTrue (r.MoveToElement (), label + "#24");

Expand Down

0 comments on commit 0afa9b2

Please sign in to comment.