Files
mono/mcs/class/System.XML/System.Xml/XmlLinkedNode.cs
T
Atsushi Eno fdf21b83be 2004-02-04 Atsushi Enomoto <[email protected]>
* DTDObjectModel.cs : Never expand entity on ScanEntityValue().
	* DTDValidatingReader.cs : XmlDeclaration node requires attributes
	  to be movable.
	* XmlAttribute.cs,
	  XmlDocument.cs,
	  XmlDocumentFragment.cs,
	  XmlElement.cs,
	  XmlEntity.cs,
	  XmlLinkedNode.cs,
	  XmlNode.cs,
	  XmlNotation.cs :
	  Added namespace checking flag (required for such xml readers
	  that holds Namespaces=false). Now only XmlNode holds LastLinkedNode.
	* XmlDocumentType.cs,
	  XmlEntity.cs,
	  XmlEntityReference.cs : The children of Entity and EntityReference
	  became correct. They now holds parsed nodes, but it is only when
	  they are appended to the document.
	* XmlNode.cs : Modified insertBeforeIntern() to InsertBefore() with
	  boolean checkNodeType argument.  This method also tries to create
	  Entity's and EntityReference's child nodes.  Also added internal
	  RemoveChild() with boolean checkNodeType argument.
	* XmlNodeReader.cs : Quick hack for ResolveEntity() that became
	  broken with these changes. use InnerXml as input to entityReader.
	* XmlTextReader.cs : XmlDeclaration's value LocalName should be the
	  same as Name.  The names of DTD's pseudo attributes should be empty.
	  Fixed DTD node's Depth (was regarded as attribute value's depth).

svn path=/trunk/mcs/; revision=22767
2004-02-04 17:48:06 +00:00

78 lines
1.3 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
internal bool IsRooted {
get {
for (XmlNode n = ParentNode; n != null; n = n.ParentNode)
if (n.NodeType == XmlNodeType.Document)
return true;
return false;
}
}
public override XmlNode NextSibling
{
get {
if(ParentNode == null) {
return null;
}
else 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
}
}