Show / Hide Table of Contents

Class SimpleDocument

A simple implementation of the IXmlDocument interface.

Inheritance
object
SimpleValue
SimpleElement
SimpleDocument
Implements
IPortableObject
IXmlDocument
IXmlElement
IXmlValue
ICloneable
Inherited Members
SimpleElement.Name
SimpleElement.Root
SimpleElement.AbsolutePath
SimpleElement.ElementList
SimpleElement.GetElement(string)
SimpleElement.GetElements(string)
SimpleElement.AddElement(string)
SimpleElement.FindElement(string)
SimpleElement.GetSafeElement(string)
SimpleElement.EnsureElement(string)
SimpleElement.Attributes
SimpleElement.GetAttribute(string)
SimpleElement.SetAttribute(string, IXmlValue)
SimpleElement.AddAttribute(string)
SimpleElement.GetSafeAttribute(string)
SimpleElement.Comment
SimpleElement.WriteValue(TextWriter, bool)
SimpleElement.IsNameMutable
SimpleElement.InstantiateElementList()
SimpleElement.InstantiateElement(string, object)
SimpleElement.InstantiateAttributes()
SimpleElement.InstantiateAttribute()
SimpleElement.WriteEmptyTag(TextWriter, bool)
SimpleElement.WriteStartTag(TextWriter, bool)
SimpleElement.WriteEndTag(TextWriter, bool)
SimpleElement.WriteAttributes(TextWriter, bool)
SimpleElement.WriteComment(TextWriter, bool)
SimpleElement.WriteChildren(TextWriter, bool)
SimpleElement.ToString()
SimpleElement.ToString(bool)
SimpleElement.Clone()
SimpleValue.GetBoolean()
SimpleValue.GetBoolean(bool)
SimpleValue.SetBoolean(bool)
SimpleValue.GetInt()
SimpleValue.GetInt(int)
SimpleValue.SetInt(int)
SimpleValue.GetLong()
SimpleValue.GetLong(long)
SimpleValue.SetLong(long)
SimpleValue.GetDouble()
SimpleValue.GetDouble(double)
SimpleValue.SetDouble(double)
SimpleValue.GetDecimal()
SimpleValue.GetDecimal(decimal)
SimpleValue.SetDecimal(decimal)
SimpleValue.GetString()
SimpleValue.GetString(string)
SimpleValue.SetString(string)
SimpleValue.GetBinary()
SimpleValue.GetBinary(Binary)
SimpleValue.SetBinary(Binary)
SimpleValue.GetDateTime()
SimpleValue.GetDateTime(DateTime)
SimpleValue.SetDateTime(DateTime)
SimpleValue.Value
SimpleValue.Parent
SimpleValue.IsEmpty
SimpleValue.IsAttribute
SimpleValue.IsContent
SimpleValue.IsMutable
SimpleValue.InternalValue
SimpleValue.EnsureType(XmlValueType)
SimpleValue.Convert(object, XmlValueType)
object.Equals(object, object)
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: Tangosol.Run.Xml
Assembly: Coherence.dll
Syntax
public class SimpleDocument : SimpleElement, IPortableObject, IXmlDocument, IXmlElement, IXmlValue, ICloneable
Remarks

Protected methods are provided to support inheriting classes.

Constructors

SimpleDocument()

Construct an empty SimpleDocument.

Declaration
public SimpleDocument()

SimpleDocument(string)

Construct a SimpleDocument.

Declaration
public SimpleDocument(string name)
Parameters
Type Name Description
string name

The name of the root element.

SimpleDocument(string, string, string)

Construct a SimpleDocument.

Declaration
public SimpleDocument(string name, string dtdUri, string dtdName)
Parameters
Type Name Description
string name

The name of the root element.

string dtdUri

The URI of the DTD (system identifier).

string dtdName

The name of the DTD (public identifier); may be null.

Properties

DocumentComment

Get or set the XML comment that appears outside of the root element.

Declaration
public virtual string DocumentComment { get; set; }
Property Value
Type Description
string

The document comment.

Remarks

This differs from the Comment property of this object, which refers to the comment within the root element.

DtdName

Get or set the public identifier of the DTD (DOCTYPE) for the document.

Declaration
public virtual string DtdName { get; set; }
Property Value
Type Description
string

The DTD public identifier.

Examples

-//Sun Microsystems, Inc.//DTD Web Application 1.2//EN

DtdUri

Get or set the URI of the DTD (DOCTYPE) for the document.

Declaration
public virtual string DtdUri { get; set; }
Property Value
Type Description
string

The document type URI.

Remarks

This is referred to as the System Identifier by the XML specification.

Examples

http://java.sun.com/j2ee/dtds/web-app_2_2.dtd

Encoding

Get or set the encoding string for the XML document.

Declaration
public virtual string Encoding { get; set; }
Property Value
Type Description
string

The encoding set for the document.

Remarks

Documents that are parsed may or may not have the encoding string from the persistent form of the document.

Methods

CheckMutable()

Validates that the element is mutable, otherwise throws an InvalidOperationException.

Declaration
protected override void CheckMutable()
Overrides
SimpleElement.CheckMutable()
Exceptions
Type Condition
InvalidOperationException

Equals(object)

Compare this XML document and all of its contained information with another XML document for equality.

Declaration
public override bool Equals(object o)
Parameters
Type Name Description
object o

The object to compare to.

Returns
Type Description
bool

true if the documents are equal, false otherwise.

Overrides
SimpleElement.Equals(object)
Remarks

Note that this overrides the contract of the Equals() method in the super interface IXmlElement.

GetHashCode()

Provide a hash value for this XML document and all of its contained information.

Declaration
public override int GetHashCode()
Returns
Type Description
int

The hash value for this XML value.

Overrides
SimpleElement.GetHashCode()
Remarks

Note that this overrides the contract of the GetHashCode() method in the super interface IXmlElement. The hash value is defined as a xor of the following:

  1. the GetHashCode() from the root element
  2. the GetHashCode() from the document type (uri and optional name)

ReadExternal(IPofReader)

Restore the contents of a user type instance by reading its state using the specified IPofReader object.

Declaration
public override void ReadExternal(IPofReader reader)
Parameters
Type Name Description
IPofReader reader

The IPofReader from which to read the object's state.

Overrides
SimpleElement.ReadExternal(IPofReader)
Exceptions
Type Condition
IOException

If an I/O error occurs.

WriteExternal(IPofWriter)

Save the contents of a POF user type instance by writing its state using the specified IPofWriter object.

Declaration
public override void WriteExternal(IPofWriter writer)
Parameters
Type Name Description
IPofWriter writer

The IPofWriter to which to write the object's state.

Overrides
SimpleElement.WriteExternal(IPofWriter)
Exceptions
Type Condition
IOException

If an I/O error occurs.

WriteXml(TextWriter, bool)

Write the XML document, including an XML header and DOCTYPE if one exists.

Declaration
public override void WriteXml(TextWriter writer, bool isPretty)
Parameters
Type Name Description
TextWriter writer

A TextWriter object to use to write to.

bool isPretty

true to specify that the output is intended to be as human readable as possible.

Overrides
SimpleElement.WriteXml(TextWriter, bool)
Remarks

This overrides the contract of the IXmlElement super interface.

Implements

IPortableObject
IXmlDocument
IXmlElement
IXmlValue
ICloneable

Extension Methods

IXmlDocumentExtension.IterateThroughAllNodes(IXmlDocument, Action<IXmlElement>)
In this article
Back to top Copyright © 2000, 2024, Oracle and/or its affiliates.