SaxonC 12.5
Saxon Processor library for C/C++, PHP and Python
|
#include <XdmNode.h>
Public Member Functions | |
XdmNode (int64_t) | |
XdmNode (XdmNode *parent, int64_t, XDM_NODE_KIND kind) | |
XdmNode (const XdmNode &other) | |
virtual | ~XdmNode () |
Destructor. | |
virtual bool | isAtomic () |
Determine whether the item is an atomic value or some other type of item. | |
XdmItem * | getHead () |
Get the first item in the sequence. | |
XDM_NODE_KIND | getNodeKind () |
Get the kind of node. | |
const char * | getNodeName () |
const char * | getLocalName () |
XdmValue * | getTypedValue () |
Get the typed value of this node, as defined in XDM. | |
int | getLineNumber () |
Get the line number of the node in a source document. | |
int | getColumnNumber () |
Get the column number of the node in a source document. | |
const char * | getBaseUri () |
Get the base URI of this node. | |
const char * | getStringValue () |
const char * | toString () |
XdmNode * | getParent () |
Get the parent of this node. | |
const char * | getAttributeValue (const char *name) |
int | getAttributeCount () |
Get the number of attribute node for this current node. | |
XdmNode ** | getAttributeNodes (bool cache=false) |
Get array of attribute nodes of this element. | |
XdmNode ** | axisNodes (EnumXdmAxis axis) |
Get the array of nodes reachable from this node via a given axis. | |
EnumXdmAxis | convertEnumXdmAxis (int n) |
int | axisNodeCount () |
int64_t | getUnderlyingValue () |
Get the underlying JNI Java object for the XdmNode. | |
bool | isNode () |
Determine whether the item is a node or some other type of item. | |
XdmNode ** | getChildren (bool cache=false) |
Get all the child nodes from the current parent node. | |
XdmNode * | getChild (int i, bool cache=false) |
Get the ith child nodes from the current parent node. | |
int | getChildCount () |
Get the count of child nodes from the current node. | |
XDM_TYPE | getType () |
Get the type of the object. | |
void | resetRelinquishedChildren () |
void | incrementRefCountForRelinquishedChildren () |
bool | hasRelinquishedChildren () |
Public Member Functions inherited from XdmItem | |
XdmItem () | |
XdmItem default constructor. | |
XdmItem (int64_t) | |
XdmItem (const XdmItem &item) | |
Copy constructor. | |
virtual | ~XdmItem () |
Destructor. | |
virtual void | incrementRefCount () |
virtual void | decrementRefCount () |
virtual bool | isFunction () |
virtual bool | isMap () |
virtual bool | isArray () |
XdmItem * | itemAt (int n) |
int | size () |
Public Member Functions inherited from XdmValue | |
XdmValue () | |
A default Constructor. | |
XdmValue (const XdmValue &other) | |
A copy constructor. | |
XdmValue * | addXdmValueWithType (const char *tStr, const char *val) |
Add an XdmItem to the sequence. | |
void | addXdmItem (XdmItem *val) |
void | addXdmItemFromUnderlyingValue (XdmItem *val) |
void | addUnderlyingValue (int64_t val) |
XdmValue (int64_t val, bool arrFlag) | |
A Constructor for handling XdmArray - Internal user only. | |
XdmValue (int64_t val) | |
A Constructor. | |
virtual | ~XdmValue () |
Destructor. | |
void | releaseXdmValue () |
int | getRefCount () |
Get the number of references on this XdmValue. | |
void | resetRelinquishedItems () |
void | incrementRefCountForRelinquishedValue (int i) |
Static Public Member Functions | |
static void | deleteChildrenArray (XdmNode **fetchedChildren) |
Additional Inherited Members | |
Protected Member Functions inherited from XdmValue | |
void | initialize () |
initialize this XdmValue with default values | |
Protected Attributes inherited from XdmItem | |
int64_t | value |
const char * | stringValue |
const char * | itemToString |
Protected Attributes inherited from XdmValue | |
char * | valueType |
XdmItem ** | values |
char * | relinquished_values |
int | values_cap |
int | xdmSize |
int | refCount |
This class represents a node in the XDM data model. A Node is an XdmItem
, and is therefore an XdmValue
in its own right, and may also participate as one item within a sequence value.
The XdmNode interface exposes basic properties of the node, such as its name, its string value, and its typed value.
Note that node identity cannot be inferred from object identity. The same node may be represented by different XdmNode
instances at different times, or even at the same time. The equals() method on this class can be used to test for node identity.
XdmNode::XdmNode | ( | int64_t | obj | ) |
XdmNode::XdmNode | ( | XdmNode * | parent, |
int64_t | obj, | ||
XDM_NODE_KIND | kind ) |
XdmNode::XdmNode | ( | const XdmNode & | other | ) |
Copy constructor
other | The node being copied |
|
virtual |
Destructor.
Destructor for XdmNode
int XdmNode::axisNodeCount | ( | ) |
Get the count of nodes in the nodeAxis array. Cached from the last call to nodeAxis
XdmNode ** XdmNode::axisNodes | ( | EnumXdmAxis | axis | ) |
Get the array of nodes reachable from this node via a given axis.
axis | - identifies which axis is to be navigated. Axis options are as follows: ANCESTOR = 0, ANCESTOR_OR_SELF = 1, ATTRIBUTE = 2, CHILD = 3, DESCENDANT = 4, DESCENDANT_OR_SELF = 5, FOLLOWING = 6, FOLLOWING_SIBLING = 7, NAMESPACE = 8, PARENT = 9, PRECEDING = 10, PRECEDING_SIBLING = 11, SELF = 12 |
|
inline |
Convert an int into the corresponding EnumXdmAxis Enum object
n | - the integer value for the XDM axis |
|
inlinestatic |
Utility method required for python and PHP extension to delete string created in the C++ code-base
fetchedChildren | - the array of pointers to child nodes to be deleted |
int XdmNode::getAttributeCount | ( | ) |
Get the number of attribute node for this current node.
XdmNode ** XdmNode::getAttributeNodes | ( | bool | cache = false | ) |
Get array of attribute nodes of this element.
cache | - deprecated. User is responsible for memory management for the attribute nodes. |
const char * XdmNode::getAttributeValue | ( | const char * | name | ) |
Get the string value of a named attribute (in no namespace) of this element
name | the name of the required attribute, interpreted as a no-namespace name |
const char * XdmNode::getBaseUri | ( | ) |
Get the base URI of this node.
XdmNode * XdmNode::getChild | ( | int | i, |
bool | cache = false ) |
Get the ith child nodes from the current parent node.
Caching is no longer used, the value of cache is ignored. This param is deprecated and will be removed in a later version.ß
int XdmNode::getChildCount | ( | ) |
Get the count of child nodes from the current node.
XdmNode ** XdmNode::getChildren | ( | bool | cache = false | ) |
Get all the child nodes from the current parent node.
Caching is no longer used, the value of cache is ignored. This param is deprecated and will be removed in a later version.ß
int XdmNode::getColumnNumber | ( | ) |
Get the column number of the node in a source document.
|
virtual |
int XdmNode::getLineNumber | ( | ) |
Get the line number of the node in a source document.
const char * XdmNode::getLocalName | ( | ) |
Get the local name of the node. The caller does not need to deallocate memory.
XDM_NODE_KIND XdmNode::getNodeKind | ( | ) |
Get the kind of node.
XdmNodeKind::ELEMENT
or XdmNodeKind::ATTRIBUTE
const char * XdmNode::getNodeName | ( | ) |
Get the name of the node, as a string in the form of a EQName. The caller does not need to deallocate memory.
XdmNode * XdmNode::getParent | ( | ) |
Get the parent of this node.
|
virtual |
Get the string value of the item. For a node, this gets the string value of the node. The caller should deallocate memory using delete
For an atomic value, it has the same effect as casting the value to a string. In all cases the result is the same as applying the XPath string() function.
For atomic values, the result is the same as the result of calling toString
. This is not the case for nodes, where toString
returns an XML serialization of the node.
Reimplemented from XdmItem.
|
inlinevirtual |
XdmValue * XdmNode::getTypedValue | ( | ) |
Get the typed value of this node, as defined in XDM.
XdmAtomicValue
|
inlinevirtual |
bool XdmNode::hasRelinquishedChildren | ( | ) |
Internal method to check if child nodes have been relinquished
void XdmNode::incrementRefCountForRelinquishedChildren | ( | ) |
Internal method used to increment the ref count for an relinquished child only once
|
virtual |
Determine whether the item is an atomic value or some other type of item.
Reimplemented from XdmItem.
|
inlinevirtual |
Determine whether the item is a node or some other type of item.
Reimplemented from XdmItem.
void XdmNode::resetRelinquishedChildren | ( | ) |
Internal method used to reset associated reference counts on xdmItems that have been relinquished
|
virtual |
The toString() method returns a simple XML serialization of the node with defaulted serialization parameters. The caller should deallocate memory using delete
In the case of an element node, the result will be a well-formed XML document serialized as defined in the W3C XSLT/XQuery serialization specification, using options method="xml", indent="yes", omit-xml-declaration="yes".
In the case of a document node, the result will be a well-formed XML document provided that the document node contains exactly one element child, and no text node children. In other cases it will be a well-formed external general parsed entity.
In the case of an attribute node, the output is a string in the form name="value"
. The name will use the original namespace prefix.
In the case of a namespace node, the output is a string in the form of a namespace declaration, that is xmlns="uri"
or xmlns:pre="uri"
.
Other nodes, such as text nodes, comments, and processing instructions, are represented as they would appear in lexical XML. Note: this means that in the case of text nodes, special characters such as &
and <
are output in escaped form. To get the unescaped string value of a text node, use getStringValue()
instead.
Reimplemented from XdmItem.