C# Класс HandCoded.Xml.Browser

The Browser class tracks a position of interest within a DOM document which can be moved around as the document is explored.

During traversal the Browser automatically skips over any non-element nodes in the underlying XmlDocument.

Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
context System.Xml.XmlElement
document System.Xml.XmlDocument

Открытые методы

Метод Описание
Browser ( XmlDocument document ) : System

Constructs a Browser that is attached to the root element of the XmlDocument indicated by document.

Browser ( XmlDocument document, XmlElement context ) : System

Constructs a Browser that is attached to a specific XmlElement of the given XmlDocument.

GetAttribute ( string name ) : string

Returns the value of the indicated attribute on the context element.

GetAttribute ( string name, string uri ) : string

Returns the value of the indicated attribute on the context element.

HasChildNodes ( ) : bool

Determines if the context XmlElement has at least one child element.

MoveToFirstChild ( ) : bool

Moves the context to the first child XmlElement if one exists.

MoveToLastChild ( ) : bool

Moves the context to the last child XmlElement if one exists.

MoveToNextSibling ( ) : bool

Moves the context to the next sibling XmlElement if one exists.

MoveToParent ( ) : bool

Moves the context to the parent XmlElement if one exists.

MoveToPreviousSibling ( ) : bool

Moves the context to the previous sibling XmlElement if one exists.

Описание методов

Browser() публичный Метод

Constructs a Browser that is attached to the root element of the XmlDocument indicated by document.
public Browser ( XmlDocument document ) : System
document System.Xml.XmlDocument The to explore.
Результат System

Browser() публичный Метод

Constructs a Browser that is attached to a specific XmlElement of the given XmlDocument.
public Browser ( XmlDocument document, XmlElement context ) : System
document System.Xml.XmlDocument The to explore.
context System.Xml.XmlElement The initial context .
Результат System

GetAttribute() публичный Метод

Returns the value of the indicated attribute on the context element.
public GetAttribute ( string name ) : string
name string The name of the required attribute.
Результат string

GetAttribute() публичный Метод

Returns the value of the indicated attribute on the context element.
public GetAttribute ( string name, string uri ) : string
name string The name of the required attribute.
uri string The attribute's owning namespace.
Результат string

HasChildNodes() публичный Метод

Determines if the context XmlElement has at least one child element.
public HasChildNodes ( ) : bool
Результат bool

MoveToFirstChild() публичный Метод

Moves the context to the first child XmlElement if one exists.
public MoveToFirstChild ( ) : bool
Результат bool

MoveToLastChild() публичный Метод

Moves the context to the last child XmlElement if one exists.
public MoveToLastChild ( ) : bool
Результат bool

MoveToNextSibling() публичный Метод

Moves the context to the next sibling XmlElement if one exists.
public MoveToNextSibling ( ) : bool
Результат bool

MoveToParent() публичный Метод

Moves the context to the parent XmlElement if one exists.
public MoveToParent ( ) : bool
Результат bool

MoveToPreviousSibling() публичный Метод

Moves the context to the previous sibling XmlElement if one exists.
public MoveToPreviousSibling ( ) : bool
Результат bool

Описание свойств

context защищенное свойство

The context XmlElement.
protected XmlElement,System.Xml context
Результат System.Xml.XmlElement

document защищенное свойство

The underlying XmlDocument.
protected XmlDocument,System.Xml document
Результат System.Xml.XmlDocument