Files
mono/mcs/class/System.XML/System.Xml/XmlLinkedNode.cs
T
Jason Diamond 4d82c52aeb In System.Xml:
* XmlDocumentNavigator.cs: Added file to directory.

* XmlNode.cs (CreateNavigator): Implemented.
(InnerText): Implemented.

* XmlDocument.cs (NamespaceURI, Prefix): Return String.Empty instead of
throwing exception.
(Load(XmlReader)): Allow for namespace qualified attributes.

* XmlElement.cs: Implemented GetAttribute(string, string) and both
GetAttributeNode overloads.
(SetAttributeNode(XmlAttribute)): Implemented.

* XmlNamedNodeMap.cs: Fixed copy/paste bugs in GetNamedItem(string, string)
and RemoveNamedItem(string, string).

* XmlLinkedNode.cs (PreviousSibling): Implemented.

* XmlTextReader.cs: Added code to maintain the order of attributes as
they're parsed. XML doesn't require this but Microsoft's parser does it and
matching them makes testing easier so now we have it, too.

In Test:

* XPathNavigatorTests.cs: Added file to directory.

* AllTests.cs: Added XPathNavigatorTests to suite.

* XmlTextReaderTests.cs: Added test to make sure attributes are ordered
like Microsoft's parser does it.

svn path=/trunk/mcs/; revision=4971
2002-05-27 19:17:13 +00:00

67 lines
1.1 KiB
C#

//
// System.Xml.XmlLinkedNode
//
// Authors:
// Jason Diamond <[email protected]>
// Kral Ferch <[email protected]>
//
// (C) 2002 Jason Diamond, Kral Ferch
//
using System;
namespace System.Xml
{
public abstract class XmlLinkedNode : XmlNode
{
#region Fields
XmlLinkedNode nextSibling;
#endregion
#region Constructors
internal XmlLinkedNode(XmlDocument doc) : base(doc) { }
#endregion
#region Properties
public override XmlNode NextSibling
{
get {
if (Object.ReferenceEquals(nextSibling, ParentNode.LastLinkedChild.NextLinkedSibling) == false) {
return nextSibling;
}
else {
return null;
}
}
}
internal XmlLinkedNode NextLinkedSibling
{
get { return nextSibling; }
set { nextSibling = value; }
}
public override XmlNode PreviousSibling
{
get {
if (ParentNode != null) {
XmlNode node = ParentNode.FirstChild;
if (node != this) {
do {
if (node.NextSibling == this)
return node;
} while ((node = node.NextSibling) != null);
}
}
return null;
}
}
#endregion
}
}