|
Unicorn XML Toolkit Version 1.00.00 |
|||||||||
� PREV CLASS �� NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |
class INode: virtual public CInterface { public: enum { ELEMENT_NODE = 1, ATTRIBUTE_NODE = 2, TEXT_NODE = 3, CDATA_SECTION_NODE = 4, ENTITY_REFERENCE_NODE = 5, ENTITY_NODE = 6, PROCESSING_INSTRUCTION_NODE = 7, COMMENT_NODE = 8, DOCUMENT_NODE = 9, DOCUMENT_TYPE_NODE = 10, DOCUMENT_FRAGMENT_NODE = 11, NOTATION_NODE = 12, NAMESPACE_NODE = 13 }; public: INode(); virtual ~INode(); public: virtual CString GetNodeName() = 0; virtual CString GetNodeValue() = 0; virtual void SetNodeValue(const CString &strValue) = 0; virtual int GetNodeType() = 0; virtual XNode GetParentNode() = 0; virtual XNodeList GetChildNodes() = 0; virtual XNode GetFirstChild() = 0; virtual XNode GetLastChild() = 0; virtual XNode GetPreviousSibling() = 0; virtual XNode GetNextSibling() = 0; virtual XNamedNodeMap GetAttributes() = 0; virtual XDocument GetOwnerDocument() = 0; virtual XNamedNodeMap GetNamespaces() = 0; public: virtual XNode InsertBefore( const XNode &pNewChild, const XNode &pRefChild) = 0; virtual XNode ReplaceChild( const XNode &pNewChild, const XNode &pOldChild) = 0; virtual XNode RemoveChild(const XNode &pOldChild) = 0; virtual XNode AppendChild(const XNode &pNewChild) = 0; virtual bool HasChildNodes() = 0; virtual XNode CloneNode(bool bDeep) = 0; virtual CString GetNamespaceUri() = 0; virtual CString GetPrefix() = 0; virtual CString GetLocalName() = 0; virtual int GetDocumentId() = 0; virtual int GetNodeId() = 0; virtual CString GetStringValue() = 0; virtual XNode GetNextDescendant(const XNode &pNode) = 0; virtual XNode GetNextNode() = 0; virtual XNode GetPreviousNode() = 0; virtual bool LookupPrefix( const CString &strPrefix, CString &strNamespaceUri) = 0; virtual bool SupportsExtensions() = 0; };
The single node in the document tree.
This class implements, with several extensions,
the C++ binding for the
Node
interface
specified by DOM.
INodeList, INamedNodeMap, IDocument
Constructor/Destructor Summary | |
INode
();
����������Constructs the node. |
|
~INode
();
����������Destroys the node. |
Function Summary | |
CString
|
GetNodeName
();
����������Returns the name of this node. |
CString
|
GetNodeValue
();
����������Returns the value of this node. |
void
|
SetNodeValue
(const CString &strValue);
����������Sets the new value of this node. |
int
|
GetNodeType
();
����������Returns the type of this node. |
XNode
|
GetParentNode
();
����������Returns the parent node of this node. |
XNodeList
|
GetChildNodes
();
����������Returns the list of child nodes of this node. |
XNode
|
GetFirstChild
();
����������Returns the first child node of this node. |
XNode
|
GetLastChild
();
����������Returns the last child node of this node. |
XNode
|
GetPreviousSibling
();
����������Returns the previous sibling node of this node. |
XNode
|
GetNextSibling
();
����������Returns the next sibling node of this node. |
XNamedNodeMap
|
GetAttributes
();
����������Returns the attribute map of this node. |
XDocument
|
GetOwnerDocument
();
����������Returns the owner document node of this node. |
XNamedNodeMap
|
GetNamespaces
();
����������Returns the namespace map of this node |
XNode
|
InsertBefore
(const XNode &pNewChild, const XNode &pRefChild);
����������Inserts the node specified by pNewChild
before the
node specified by
pRefChild
into the children list
of this node. |
XNode
|
ReplaceChild
(const XNode &pNewChild, const XNode &pOldChild);
����������Replaces the node specified by pOldChild
with the
node specified by
pNewChild
in the children list
of this node. |
XNode
|
RemoveChild
(const XNode &pOldChild);
����������Removes the node specified by pOldChild
from
the children list of this node. |
XNode
|
AppendChild
(const XNode &pNewChild);
����������Appends the node specified by pNewChild
to
the end of children list of this node. |
bool
|
HasChildNodes
();
����������Tests whether this node has children nodes. |
XNode
|
CloneNode
(bool bDeep);
����������Creates a copy of this node. |
CString
|
GetNamespaceUri
();
����������Returns the namespace URI of this node. |
CString
|
GetPrefix
();
����������Returns the namespace prefix of this node. |
CString
|
GetLocalName
();
����������Returns the local name of this node. |
int
|
GetDocumentId
();
����������Returns the unique identifier of the document owning this node. |
int
|
GetNodeId
();
����������Returns the unique identifier of this node within a document. |
CString
|
GetStringValue
();
����������Returns the string value of this node, as defined by XPath. |
XNode
|
GetNextDescendant
(const XNode &pNode);
����������Returns the node which follows this node in the subtree rooted at the node referenced by pNode
,
in the order established by the preorder traversal of that subtree. |
XNode
|
GetNextNode
();
����������Returns the node which follows this node, in the order established by the preorder traversal of the document tree. |
XNode
|
GetPreviousNode
();
����������Returns the node which precedes this node, in the order established by the preorder traversal of the document tree. |
bool
|
LookupPrefix
(const CString &strPrefix, CString &strNamespaceUri);
����������Looks up the namepace URI associated with the prefix specified by strPrefix
using namespace declarations
in scope on this node. |
bool
|
SupportsExtensions
();
����������Tests whether this node supports XDM extensions. |
Constructor/Destructor Detail |
INode();
Constructs the node.
virtual ~INode();
Destroys the node.
Function Detail |
virtual CString GetNodeName() = 0;
Returns the name of this node.
This method implements the C++ binding
for the
nodeName
attribute specified by DOM.
virtual CString GetNodeValue() = 0;
Returns the value of this node.
This method implements the C++ binding
for the
nodeValue
attribute specified by DOM.
virtual void SetNodeValue(const CString &strValue) = 0;
Sets the new value of this node.
This method implements the C++ binding
for the
nodeValue
attribute specified by DOM.
strValue
- the new value for this nodevirtual int GetNodeType() = 0;
Returns the type of this node.
This method implements the C++ binding
for the
nodeType
attribute specified by DOM.
virtual XNode GetParentNode() = 0;
Returns the parent node of this node.
This method implements the
C++ binding for the
parentNode
attribute specified by DOM.
If this node is an attribute or a namespace,
this method returns the owner element node.
This behavior is different from
that specified by DOM, which requires the
parentNode
to be null for attribute nodes.
NULL
if this node has no parentvirtual XNodeList GetChildNodes() = 0;
Returns the list of child nodes of this node.
This method implements the
C++ binding for the
childNodes
attribute specified by DOM.
Attribute and namespace nodes are not treated as children of their owner element nodes.
virtual XNode GetFirstChild() = 0;
Returns the first child node of this node.
This method implements the
C++ binding for the
firstChild
attribute specified by DOM.
NULL
if this node has no childrenvirtual XNode GetLastChild() = 0;
Returns the last child node of this node.
This method implements the
C++ binding for the
lastChild
attribute
specified by DOM.
NULL
if this node has no childrenvirtual XNode GetPreviousSibling() = 0;
Returns the previous sibling node of this node.
This method implements the C++ binding for
the
previousSibling
attribute specified by DOM.
NULL
if this node has no previous siblingvirtual XNode GetNextSibling() = 0;
Returns the next sibling node of this node.
This method implements the C++ binding for
the
nextSibling
attribute specified by DOM.
NULL
if this node has no next siblingvirtual XNamedNodeMap GetAttributes() = 0;
Returns the attribute map of this node.
This method implements the C++ binding for
attributes
attribute specified by DOM.
If the node supports XDM extensions, then namespace
attributes (i.e., those having names started
with
"xmlns"
") are not included in the
attribute map.
NULL
if this node does not represent an elementvirtual XDocument GetOwnerDocument() = 0;
Returns the owner document node of this node.
This method implements the C++ binding for
parentNode
attribute specified by DOM.
virtual XNamedNodeMap GetNamespaces() = 0;
Returns the namespace map of this node
This is an extension having no equivalent in DOM. If this node does not support XDM extensions, the returned namespace map is always empty.
NULL
if this node does not represent an elementvirtual XNode InsertBefore( const XNode &pNewChild, const XNode &pRefChild) = 0;
Inserts the node specified by
pNewChild
before the
node specified by
pRefChild
into the children list
of this node.
This method implements the C++ binding for
the
insertBefore
operation specified by DOM.
pNewChild
- the node to be insertedpRefChild
- the child node before which
the new node must be inserted, or
NULL
if the
new node must be appended to the end of the children listpNewChild
)virtual XNode ReplaceChild( const XNode &pNewChild, const XNode &pOldChild) = 0;
Replaces the node specified by
pOldChild
with the
node specified by
pNewChild
in the children list
of this node.
This method implements the C++ binding for
the
replaceChild
operation specified by DOM.
pNewChild
- the replacing nodepOldChild
- the node to replacepOldChild
)virtual XNode RemoveChild(const XNode &pOldChild) = 0;
Removes the node specified by
pOldChild
from
the children list of this node.
This method implements the C++ binding for
removeChild
operation specified by DOM.
pOldChild
- the node to removepOldChild
)virtual XNode AppendChild(const XNode &pNewChild) = 0;
Appends the node specified by
pNewChild
to
the end of children list of this node.
This method implements the C++ binding for
the
appendChild
operation specified by DOM.
pNewChild
- the node to appendpNewChild
)virtual bool HasChildNodes() = 0;
Tests whether this node has children nodes.
This method implements the C++ binding for
the
hasChildren
operation specified by DOM.
true
if this node has children nodes;
false
otherwisevirtual XNode CloneNode(bool bDeep) = 0;
Creates a copy of this node.
This method implements the C++ binding for
the
cloneNode
operation specified by DOM.
bDeep
- when
true
, this node is cloned together
with all descendant nodes;
when
false
, only this node is clonedvirtual CString GetNamespaceUri() = 0;
Returns the namespace URI of this node.
If this node supports XDM extensions, the namespace URI is determined using the namespace map attached to this node. If this node does not support XDM extensions, the namespace URI is determined using the namespace attributes attached to this node and to all ancestor nodes.
This is an extension XDM method that has no equivalent in
DOM Level 1 and has very different semantics then the
namespaceURI
attribute defined by DOM Level 2.
virtual CString GetPrefix() = 0;
Returns the namespace prefix of this node.
This is an extension XDM method that has no equivalent in DOM Level 1.
virtual CString GetLocalName() = 0;
Returns the local name of this node.
This is an extension XDM method that has no equivalent in DOM Level 1.
virtual int GetDocumentId() = 0;
Returns the unique identifier of the document owning this node.
The document identifier is an integer that is unique for
each instance of
IDocument
class.
This is an extension XDM method that has no equivalent in DOM.
virtual int GetNodeId() = 0;
Returns the unique identifier of this node within a document.
The node identifier is an integer that is unique for each node within any single document. Node identifiers are not globally unique: nodes owned by different documents may have the same values of node identifiers.
Within each document, identifiers are assigned to nodes in order of their creation; nodes created first receive smaller identifiers.
This is an extension XDM method that has no equivalent in DOM.
virtual CString GetStringValue() = 0;
Returns the string value of this node, as defined by XPath.
This is an extension XDM method that has no equivalent in DOM.
virtual XNode GetNextDescendant(const XNode &pNode) = 0;
Returns the node which follows this node in the subtree
rooted at the node referenced by
pNode
,
in the order established by the preorder traversal of that subtree.
This is an extension XDM method that has no equivalent in DOM.
pNode
- the root of the subtreepNode
,
in the order established by the preorder traversal of that subtree,
or
NULL
if there is no such node in the subtreevirtual XNode GetNextNode() = 0;
Returns the node which follows this node, in the order established by the preorder traversal of the document tree.
This is an extension XDM method that has no equivalent in DOM.
NULL
if there is no such nodevirtual XNode GetPreviousNode() = 0;
Returns the node which precedes this node, in the order established by the preorder traversal of the document tree.
This is an extension XDM method that has no equivalent in DOM.
NULL
if there is no such nodevirtual bool LookupPrefix( const CString &strPrefix, CString &strNamespaceUri) = 0;
Looks up the namepace URI associated with the prefix
specified by
strPrefix
using namespace declarations
in scope on this node.
If this node supports XDM extensions, the namespace URI is calculated using the namespace map attached to this node. If this node does not support XDM extensions, the namespace URI is calculated using the namespace attributes attached to this node and to all ancestor nodes.
The empty prefix can be
specified using the empty string. The special value
of
"#default"
can be also used to specify
the empty prefix; this feature was introduced for interoperability
with other libraries and is not recommended for use in the
new software.
If the prefix specified is bound to the default namespace, the empty string is returned.
This is an extension XDM method that has no equivalent in DOM.
strPrefix
- the prefix to searchstrNamespaceUri
- on return, the namespace URI bound to the
prefix specified, or undefined if the prefix is not
declared on this nodetrue
if the prefix is declared
on this node;
false
otherwisevirtual bool SupportsExtensions() = 0;
Tests whether this node supports XDM extensions.
This is an extension XDM method that has no equivalent in DOM.
true
if this node supports
XDM extensions;
false
otherwise
|
Unicorn XML Toolkit Version 1.00.00 |
|||||||||
� PREV CLASS �� NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |