Overview
A Node represents a single node in the Document tree.
Attribute Summary
name | type | description |
---|---|---|
Public | ||
baseURI | String |
holds the nodes base URI |
children | Node[] |
Holds the children node to this node When a new child node is added, the parent node for the child node is set to this node. |
document | Document |
holds the associated document |
doIndent | Boolean |
indicates whether or not indenting should be used when printing or serializing. |
domNode | Node |
holds the associated dom node |
encoding | String |
indicates which encoding should be used when printing or serializing. |
indent | Integer |
Holds the number of spaces for indenting when printing or serializing. |
localName | String |
holds the node's local Nnme |
name | String |
holds the node's qualified name |
namespaceURI | String |
holds the node's namespace |
omitXMLDeclaration | Boolean |
indicates whether or not to include the xml declaration when printing or serializing. |
parent | Node |
Holds the parent node for this node. |
prefix | String |
holds the node's prefix |
standalone | Boolean |
indicates whether or not the document is standalone. |
type | NodeType |
holds the node's type |
value | String |
holds the node's value |
Protected |
Inherited Attributes
Function Summary
- protected createNode() : Node
-
create a default node based on this node's node type
- protected isChild(node: Node, ) : Boolean
-
determine whether the node's dom node is already a child of this dom node.
- public nomalize() : Void
-
normalize the node tree
- public query(query: String, ) : <any>[]
-
Perform an xpath query using this node as the root
- public queryBoolean(query: String, ) : Boolean
-
Perform an xpath query using this node as the root expecting a Boolean result
- public queryNode(query: String, ) : Node
-
Perform an xpath query using this node as the root expecting a Node result
- public queryNumber(query: String, ) : Number
-
Perform an xpath query using this node as the root expecting a Number result
- public queryString(query: String, ) : String
-
Perform an xpath query using this node as the root expecting a String result
- public serialize(writer: Writer, ) : Void
-
Convert this node to an XML format based on the attributes indent, doIndent, omitXMLDeclaration, encoding and standalone.
- protected setDomNode(domNode: Node, ) : Void
-
set the associated properties from the dom Node
- public toString() : String
-
Convert this node to an XML formatted string based on the attributes indent, doIndent, omitXMLDeclaration, encoding and standalone.
Inherited Functions
Attributes
public baseURI: String
holds the nodes base URI
public children: Node[]
Holds the children node to this node When a new child node is added, the parent node for the child node is set to this node.
public document: Document
holds the associated document
public doIndent: Boolean
indicates whether or not indenting should be used when printing or serializing. Default is true
public domNode: Node
holds the associated dom node
public encoding: String
indicates which encoding should be used when printing or serializing. Default is null, use system default.
public indent: Integer
Holds the number of spaces for indenting when printing or serializing. doIndent must be true for this to take effect. Default indent is 2.
public localName: String
holds the node's local Nnme
public name: String
holds the node's qualified name
public namespaceURI: String
holds the node's namespace
public omitXMLDeclaration: Boolean
indicates whether or not to include the xml declaration when printing or serializing. Default is false (xml declaration is included).
public parent: Node
Holds the parent node for this node. When changed, the parent children sequence is modified to include this node.
public prefix: String
holds the node's prefix
public standalone: Boolean
indicates whether or not the document is standalone. Default is false
public type: NodeType
holds the node's type
public value: String
holds the node's value
Functions
protected createNode():Node
-
Returns
- Node
- the node
create a default node based on this node's node type
protected isChild(node: Node, ):Boolean
-
Parameters
- node
- the node to check
-
Returns
- Boolean
- true if the node's dom node is already a child of this dom node.
determine whether the node's dom node is already a child of this dom node.
public nomalize():Void
normalize the node tree
public query(query: String, ):<any>[]
-
Parameters
- query
- the xpath query
-
Returns
- <any>[]
- a sequence of Nodes that match the query
Perform an xpath query using this node as the root
public queryBoolean(query: String, ):Boolean
-
Parameters
- query
- the xpath query
-
Returns
- Boolean
- a boolean value representing the result of the query
Perform an xpath query using this node as the root expecting a Boolean result
public queryNode(query: String, ):Node
-
Parameters
- query
- the xpath query
-
Returns
- Node
- a Node representing the result of the query
Perform an xpath query using this node as the root expecting a Node result
public queryNumber(query: String, ):Number
-
Parameters
- query
- the xpath query
-
Returns
- Number
- a number value representing the result of the query
Perform an xpath query using this node as the root expecting a Number result
public queryString(query: String, ):String
-
Parameters
- query
- the xpath query
-
Returns
- String
- a string value representing the result of the query
Perform an xpath query using this node as the root expecting a String result
public serialize(writer: Writer, ):Void
-
Parameters
- writer
- the java.io.Writer that will receive the formated xml.
Convert this node to an XML format based on the attributes indent, doIndent, omitXMLDeclaration, encoding and standalone. Output is written to the Writer.
protected setDomNode(domNode: Node, ):Void
-
Parameters
- domNode
- the dom node
set the associated properties from the dom Node
public toString():String
-
Returns
- String
- an XML formatted string
Convert this node to an XML formatted string based on the attributes indent, doIndent, omitXMLDeclaration, encoding and standalone.