FOM Reference > DOM Support > XPath Extensions > fxDocument interface
  
fxDocument interface
The 3b2 extension to the W3C DOM Level 2 Document interface.
baseURI attribute
The data member used to hold the XML Base URI value.
baseURI
Access
read-only
Returns
String
defaultLanguage attribute
The language returned by fxElement.getLanguage() when no language specification is found in the XML document. The default value is en. Language mappings are applied to the default language. See setLanguageMapping().
defaultLanguage
Access
read-write
Returns
String
endContent attribute
Returns the content end position of the fxDocument node in a XML stream.
endContent
Access
read-only
Returns
int
endPosition attribute
Returns the end position of the fxDocument node in a XML stream.
endPosition
Access
read-only
Returns
int
extendedNodeType attribute
The 3b2 extension to the W3C DOM Level 2 xmlNode interface.
extendedNodeType
Access
read-only
Returns
unsigned short
idRefs attribute
An array of IDREFS attributes.
idRefs
Access
read-only
Returns
fArray
ids attribute
An array of ID attributes.
ids
Access
read-only
Returns
fArray
languageAttrName attribute
The XML attribute used for language determination in this document. The default is xml:lang. This is used by fxElement.getLanguage().
languageAttrName
Access
read-write
Returns
String
namespacesInScope attribute
Pointer to associated namespace.
namespacesInScope
Access
read-only
Returns
fArray
nodeNumber attribute
Returns the id number of the fxDocument node in a XML stream.
nodeNumber
Access
read-only
Returns
int
ownerStream attribute
The stream that owns this XML document, i.e. doc.ownerStrean.xmlDocument == doc.
ownerStream
Access
read-only
Returns
fStream
significantWhitespace attribute
3b2 node information ( x3b2NodeInfo) for handling whitespace.
significantWhitespace
Access
read-only
Returns
int
startContent attribute
Returns the content start position of the fxDocument node in a XML stream.
startContent
Access
read-only
Returns
int
startPosition attribute
Returns the start position of the fxDocument 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
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.
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.
getLanguageFromAttr method
Applies the language mappings to an attribute value. Normally this method isn't called directly but is called by fxElement.getLanguage(). If the attribute value has a mapping, then the mapped value is returned. If the passed in value is blank, then the default language is returned. Otherwise, the passed in value is returned. See setLanguageMapping() for configuring language mappings.
getLanguageFromAttrattrValue
Parameters
StringattrValue
An attribute value to be mapped to a language.
Returns
String. A language code.
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.
hasIDRefs method
Used to return a boolean value if any IDREFS attributes are declared.
hasIDRefs
Parameters
None
Returns
booleantrue if any IDREFS attributes are declared, false otherwise.
hasIDs method
Used to return a boolean value if any ID attributes are declared.
hasIDs
Parameters
None
Returns
booleantrue if any ID attributes are declared, false otherwise.
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.
setLanguageMapping method
Configures language mappings used by fxDocument.getLanguageFromAttr() and fxElement.getLanguage(). Language mappings are attribute value and language code pairs that determine the language code for a given attribute value. If language codes are set in the xml, then language mappings might not be necessary. Language mappings are used to map non-language code values to language codes or to map one language code to another language code.
setLanguageMappingattrValuelang
Parameters
StringattrValue
The attribute value to be mapped to a language code
Stringlang
The language code that the attribute value represents. Example values are en, en-us, or fr.
Returns
void
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.