FOM Reference > DOM Support > XPath Extensions > fxNode interface
  
fxNode interface
The 3b2 extension to the W3C DOM Level 2 xmlNode interface.
NodeType enumeration
An integer indicating which type of node this is.
* 
Numeric codes up to 200 are reserved to W3C for possible future use.
The NodeType enumeration has the following constants of type unsigned short.
TYPE_HTML_DOCUMENT_NODE = 201
The type for HTML document nodes.
TYPE_ELEMENT_DECL = 202
The type for element declaration nodes.
TYPE_ATTRIBUTE_DECL = 203
The type for attribute declaration nodes.
TYPE_ENTITY_DECL = 204
The type for entity declaration nodes.
TYPE_NAMESPACE_DECL = 205
The type for namespace declaration nodes.
TYPE_XINCLUDE_START = 206
The type for XINCLUDE_START nodes.
TYPE_XINCLUDE_END = 207
The type for XINCLUDE_END nodes.
TYPE_DOCB_DOCUMENT_NODE = 208
The type for Docbook document nodes.
TYPE_TEXT_WHITESPACE_NODE = 209
The type for a text node containing just whitespace.
TYPE_ROOT_ATTR = 210
The type for root attribute node.
TYPE_VERSION_ATTR = 211
The type for the attribute node containing version information.
TYPE_ENCODING_ATTR = 212
The type for the attribute node containing encoding information.
TYPE_STANDALONE_ATTR = 213
The type for the attribute node containing standalone information.
TYPE_MISCWS_ATTR = 214
The type for the attribute node containing miscellaneous whitespace.
TYPE_ENTITY_REF = 215
The type for the entity reference node.
whitespaceTypes enumeration
3b2 node information ( x3b2NodeInfo) for handling whitespace.
The whitespaceTypes enumeration has the following constants of type int.
WS_NOT_WELL_FORMED = -1
The type for whitespace that is not well formed.
WS_INSIGNIFICANT = 0
The type for insignificant whitespace.
WS_SIGNIFICANT_XMLSPACE = 1
The type used to when the attribute xml:space is set to preserve.
WS_SIGNIFICANT_DTD = 2
The type used for significant whitespace in a DTD.
WS_NOT_TEXT_NODE = 3
The type used for whitespace but not in a text node context.
WS_NO_DTD = 4
The type used for whitespace found but no DTD.
WS_NOT_IN_DTD = 5
The type used for a whitespace element found but not in a DTD.
AugmentationType enumeration
An integer indicating which type of augmentation is presen on this node.
The AugmentationType enumeration has the following constants of type unsigned short.
AUGMENTATION_NONE = 0
No Augmentation is present on the node.
AUGMENTATION_BEFORE = 0x01
The node has Augmentation Before the real chilren of the node.
AUGMENTATION_AFTER = 0x02
The node has Augmentation After the real chilren of the node.
AUGMENTATION_REFERENCE = 0x04
The node has Augmentation References.
augFirstChild attribute
This property adds additional support for DOMs attached to an fTag.TYPE_XML_TREE stream.
This returns the first child node found within the node in the following order. Augmenation Before, Augmentation References, children, Augmenation After. Otherwise, this returns null.
augFirstChild
Access
read-only
Returns
Node
augLastChild attribute
This property adds additional support for DOMs attached to an fTag.TYPE_XML_TREE stream.
This returns the last child node found within the node in the following order. Augmenation After, children, Augmentation References, Augmenation Before. Otherwise, this returns null.
augLastChild
Access
read-only
Returns
Node
augNextSibling attribute
This property adds additional support for DOMs attached to an fTag.TYPE_XML_TREE stream.
This returns the node logically following this node within it's parent, including augmentation. The logical order is: Augmenation Before, Augmentation References, children, Augmenation After. Otherwise, this returns null.
augNextSibling
Access
read-only
Returns
Node
augParentNode attribute
This property adds additional support for DOMs attached to an fTag.TYPE_XML_TREE stream.
The parent of this node. If this node is at the root of augmentation, this returns the Node the augmentation is attached. Otherwise this returns the normal parent.
augParentNode
Access
read-only
Returns
Node
augPreviousSibling attribute
This property adds additional support for DOMs attached to an fTag.TYPE_XML_TREE stream.
This returns the node logically preceding this node within it's parent, including augmentation. The logical order is: Augmenation After, children, Augmentation References, Augmenation Before. Otherwise, this returns null.
augPreviousSibling
Access
read-only
Returns
Node
augRefererNode attribute
This property adds additional support for DOMs attached to a fTag.TYPE_XML_TREE type stream which has augmentation enabled.
If this node is within augmentation, this returns the Node which was used as the primary reference for this node. This will usually be the Node in which the augmenation is attached. If created to replace a matching context, this returns the node which matched. Otherwise, this returns itself.
augRefererNode
Access
read-only
Returns
Node
endContent attribute
Returns the content end position of a node in a XML stream.
endContent
Access
read-only
Returns
int
endPosition attribute
Returns the end position of a node in a XML stream.
endPosition
Access
read-only
Returns
int
extendedNodeType attribute
See NodeType group above for details.
extendedNodeType
Access
read-only
Returns
unsigned short
hasAugmentation attribute
This property adds additional support for DOMs attached to an fTag.TYPE_XML_TREE stream. This returns an int representing the Augmentation present on the current node, see AugmentationType.
hasAugmentation
Access
read-only
Returns
int
namespacesInScope attribute
Pointer to associated namespace.
namespacesInScope
Access
read-only
Returns
fxArray
nodeNumber attribute
Returns the id number of a specific node in a XML stream.
nodeNumber
Access
read-only
Returns
int
significantWhitespace attribute
See whitespaceTypes group above for values.
significantWhitespace
Access
read-only
Returns
int
startContent attribute
Returns the content start position of a node in a XML stream.
startContent
Access
read-only
Returns
int
startPosition attribute
Returns the start position of a node in a XML stream.
startPosition
Access
read-only
Returns
int
validAttributes attribute
Uses the DTD to return the valid attributes of a node.
validAttributes
Access
read-only
Returns
String
validContent attribute
Uses the DTD to return the valid content of a node.
validContent
Access
read-only
Returns
String
withinAugmentation attribute
This property adds additional support for DOMs attached to an fTag.TYPE_XML_TREE stream. This returns true if the current node is within augmenation of an ancestor.
withinAugmentation
Access
read-only
Returns
boolean
augSerialize method
Serialize an augmented node to a string.
augSerializecontentOnlyprettyPrint
Parameters
booleancontentOnly
If false (the default), the name and attributes of the node are included in the serialization. If true, the name and attributes of the node are omitted. In both cases, all information from the nodes children is included
booleanprettyPrint
If true, will format the serialized augmented node. If contentOnly is true, then it will not format the augmented node.
Returns
String. The serialized version of the augmented node.
augmentAfter method
This method adds additional support for DOMs attached to an fTag.TYPE_XML_TREE stream. This method will clone the provided Node or NodeList into the Augment After position. Any existing Augmentation will be removed.
augmentAfternodereferer
Parameters
Nodenode
The Node or NodeList to set as the Augmentation Before or null to remove.
fxElementreferer
The Element to set as the Referer Node for this augmentation. If null or not specified, the referer will be the current Element.
Returns
Node. The Node that was created for the augmentation. If a NodeList was used, this is the first Node created, with the remaining nodes created as siblings.
augmentBefore method
This method adds additional support for DOMs attached to an fTag.TYPE_XML_TREE stream. This method will clone the provided Node or NodeList into the Augmentation Before position. Any existing Augmentation will be removed.
augmentBeforenodereferer
Parameters
Nodenode
The Node or NodeList to set as the Augmentation Before or null to remove.
fxElementreferer
The Element to set as the Referer Node for this augmentation. If null or not specified, the referer will be the current Element.
Returns
Node. The Node that was created for the augmentation If a NodeList was used, this is the first Node created, with the remaining nodes created as siblings.
augmentReference method
This method adds additional support for DOMs attached to an fTag.TYPE_XML_TREE stream. This method will create internal PIs between the Augmentation Before and the normal children of the node. These A3B2T PIs will result in APP calling the referenced Tag directly during formatting.
augmentReferencereferencemode
Parameters
Stringreference
The reference text to use on the PI. e.g. 'resetCounter counter="test"'.
intmode
The mode to handle the reference. If 0, the reference is prepended to the internal reference list. If 1, the reference is appended to the internal reference list. If 2, the reference is removed from the internal reference list.
Returns
Node. The Node that was created for the augmentation.
evaluateXPath method
Evaluates an XPath expression string.
evaluateXPathexpression
Parameters
Stringexpression
The XPath expression string to be parsed and evaluated.
Returns
XPathResult. The result of the evaluation of the XPath expression.
Throws
XPathException
INVALID_EXPRESSION_ERR: Raised if the expression is not legal according to the rules of the XPathEvaluator.
getNodePath method
Returns an absolute location path for the xmlNode.
getNodePathmode
Parameters
intmode
If not specified, or 0, the returned path uses expanded local-name and namespace-uri syntax for elements within namespaces.
If 1, the returned path uses the specifed prefix on elements within a namespace.
mode 0: /document/chapter[1]/section[5]/node()[ local-name()="title" and namespace-uri()="URN:example:urn" ]
mode 1: /document/chapter[1]/section[5]/ex:title
Returns
String. Returns the absolute location path to this xmlNode.
getPage method
 
getPage
Parameters
None
Returns
fPage
getUserString method
Retrieves the string associated to a key on the xmlNode. The string must first have been set to this node by calling setUserString with the same key.
getUserStringkey
Parameters
Stringkey
The key to the associated string.
Returns
String. The userString associated to the given key on this xmlNode, or NULL if there was none.
getXmlBase method
Used to search for the base URI for this xmlNode. It does not return the base URI for the document.
getXmlBase
Parameters
None
Returns
String. Returns the base URI string.
getXmlLang method
The default definition. This function normally searches for the language of the xmlElement node. This can not be set for the base xmlNode - the relevant derived class will redefine this function to set it.
getXmlLang
Parameters
None
Returns
String. In the default definition, returns an empty string.
getXmlSpace method
The default definition. This function normally searches for the space preserving behaviour of an xmlElement. This can not be set for the base xmlNode - the relevant derived classes will redefine this function to set it.
getXmlSpace
Parameters
None
Returns
String. In the default definition, returns -1.
hasNamespacesInScope method
Used to see if this node has a list of namespaces.
hasNamespacesInScope
Parameters
None
Returns
booleantrue if this node has a list of namespaces, false otherwise.
lookupNamespacePrefix method
Returns the URI associated with the prefix passed in. If the prefix is not associated with a namespace, or a prefix is not passed in, the method returns null.
lookupNamespacePrefixprefix
Parameters
Stringprefix
The prefix to search for.
Returns
String. Returns the associated namespace URI or null if none is found.
serialize method
Serialize the node to a string.
serializecontentOnlyprettyPrint
Parameters
booleancontentOnly
If false (the default), the name and attributes of the node are included in the serialization. If true, the name and attributes of the node are omitted. In both cases, all information from the nodes children is included
booleanprettyPrint
If true, will format the serialized node. If contentOnly is true, then it will not format the node.
Returns
String. The serialized version of the node.
setUserString method
Used to set the userString for a specific xmlNode.
setUserStringkeydata
Parameters
Stringkey
The key to associate the string to.
Stringdata
The string to associate to the given key, or NULL to remove any existing association to that key
Returns
String. The string previously associated to the given key on this node, or NULL if there was none.