-
Method get_line_no
int Public.Parser.XML2.Node()->get_line_no()
- Returns
the line number the node is present on
-
Method set_ns
object(Node) Public.Parser.XML2.Node()->set_ns(string ns_prefix)
-
Method set_content
object(Node) Public.Parser.XML2.Node()->set_content(string content)
- Description
sets the content for a node
-
Method get_text
string Public.Parser.XML2.Node()->get_text()
- Description
gets the contents of a text node, or the contents and children of an
element, or the value of an attribute node.
-
Method get_node_path
string Public.Parser.XML2.Node()->get_node_path()
- Description
returns an XPath/XQuery based path for this Node.
-
Method get_ns
string Public.Parser.XML2.Node()->get_ns()
- Description
returns the default name space uri for the element
-
Method get_nss
mapping Public.Parser.XML2.Node()->get_nss()
- Description
gets a list of all known namespaces for this element.
- Returns
a mapping of "short" prefixes to namespace uris.
-
Method get_base
string Public.Parser.XML2.Node()->get_base()
-
Method get_lang
string Public.Parser.XML2.Node()->get_lang()
-
Method get_space_preserve
int Public.Parser.XML2.Node()->get_space_preserve()
-
Method get_attributes
mapping Public.Parser.XML2.Node()->get_attributes()
- Description
returns all attributes, irrespective of namespace
- Returns
a mapping of attribute name to attribute value.
-
Method get_no_ns_attributes
mapping Public.Parser.XML2.Node()->get_no_ns_attributes()
- Description
returns all attributes not present in a namespace
- Returns
a mapping of attribute name to attribute value.
-
Method get_ns_attributes
mapping Public.Parser.XML2.Node()->get_ns_attributes(string ns_prefix)
- Description
given a namespace uri, return all elements for that namespace
present in the element.
- Returns
a mapping of attribute names to attribute values.
-
Method children
array Public.Parser.XML2.Node()->children()
- Description
get all children of this node
- Returns
an array of all elements with are a direct child of this element.
-
Method parent
object(Node) Public.Parser.XML2.Node()->parent()
- Description
get the Node which is the parent of this Node.
-
Method get_root_node
object(Node) Public.Parser.XML2.Node()->get_root_node()
- Description
get the Node which is the root of this tree.
-
Method set_root_node
object(Node) Public.Parser.XML2.Node()->set_root_node()
- Description
set this Node to be the root of this tree.
- Returns
the old root of the tree, if any existed.
-
Method new_cdata_block
object(Node) Public.Parser.XML2.Node()->new_cdata_block(string contents)
- Description
returns an unlinked CDATA block.
-
Method new_pi
object(Node) Public.Parser.XML2.Node()->new_pi(string name, string contents)
- Description
returns a linked Processing Instruction node.
-
Methods
object(Node) Public.Parser.XML2.Node()->set_attribute(string name, string value) object(Node) Public.Parser.XML2.Node()->set_ns_attribute(string name, string ns, string value)
- Description
sets a new attribute, overwriting any existing value.
if value is zero, the attribute will be removed from the node.
-
Method delete_attribute
object Public.Parser.XML2.Node()->delete_attribute(string name, string|void ns)
-
Method new_char_ref
object(Node) Public.Parser.XML2.Node()->new_char_ref(string name)
- Description
returns an unlinked character reference node.
-
Method new_comment
object(Node) Public.Parser.XML2.Node()->new_comment(string content)
- Description
returns an unlinked character reference node.
-
Method new_child
object(Node) Public.Parser.XML2.Node()->new_child(string ns, string name, string content)
- Description
add a new child element, added to end of children for this node.
-
Method add_ns
object(Node) Public.Parser.XML2.Node()->add_ns(string href, string prefix)
-
Method add_child
object(Node) Public.Parser.XML2.Node()->add_child(object(Node) child)
- Description
add a node to end of children for this node.
-
Method add_sibling
object(Node) Public.Parser.XML2.Node()->add_sibling(object(Node) sibling)
- Description
add a node to end of siblings for this node.
-
Method add_next_sibling
object(Node) Public.Parser.XML2.Node()->add_next_sibling(object(Node) sibling)
- Description
add a sibling node after this node.
-
Method add_prev_sibling
object(Node) Public.Parser.XML2.Node()->add_prev_sibling(object(Node) sibling)
- Description
add a sibling node after this node.
-
Method get_last_child
object(Node) Public.Parser.XML2.Node()->get_last_child()
- Description
get the Node which is the last child of this Node.
-
Method next
object(Node) Public.Parser.XML2.Node()->next()
- Description
get the next sibling of this Node.
- Returns
the next node which is a sibling of this node.
-
Method prev
object(Node) Public.Parser.XML2.Node()->prev()
- Description
get the previous sibling of this Node.
- Returns
the previous node which is a sibling of this node.
-
Method is_blank
int Public.Parser.XML2.Node()->is_blank()
- Description
is this node empty?
-
Method is_text
int Public.Parser.XML2.Node()->is_text()
- Description
is this a text node?
-
Method get_node_type
int Public.Parser.XML2.Node()->get_node_type()
- Description
get the type of node.
- Returns
the integer node type. Node type constantes are
defined in Constants.
gets the name of this node, if it has one.
-
Method set_node_name
string Public.Parser.XML2.Node()->set_node_name(string name)
- Description
gets the name of this node, if it has one.
-
Method render_xml
string Public.Parser.XML2.Node()->render_xml(int level, int format)
- Description
renders the node and all children as xml.
- Parameter level
the indentation level to use
- Parameter format
should the xml be formated for ease of human reading.
this setting only takes effect if
Public.Parser.XML2.xmlKeepBlanksDefault(0) has been called.
|