# XML::XPath::Node - perldoc - [phpMan]

## NAME
    [XML::XPath::Node](https://www.chedong.com/phpMan.php/perldoc/XML%3A%3AXPath%3A%3ANode/markdown) - internal representation of a node

## API
    The Node API aims to emulate DOM to some extent, however the API isn't quite compatible with
    DOM. This is to ease transition from [XML::DOM](https://www.chedong.com/phpMan.php/perldoc/XML%3A%3ADOM/markdown) programming to [XML::XPath](https://www.chedong.com/phpMan.php/perldoc/XML%3A%3AXPath/markdown). Compatibility with DOM
    may arise once [XML::DOM](https://www.chedong.com/phpMan.php/perldoc/XML%3A%3ADOM/markdown) gets namespace support.

  new
    Creates a new node. See the sub-classes for parameters to pass to new().

  getNodeType
    Returns one of ELEMENT_NODE, TEXT_NODE, COMMENT_NODE, ATTRIBUTE_NODE,
    PROCESSING_INSTRUCTION_NODE or NAMESPACE_NODE. UNKNOWN_NODE is returned if the sub-class doesn't
    implement getNodeType - but that means something is broken! The constants are exported by
    default from [XML::XPath::Node](https://www.chedong.com/phpMan.php/perldoc/XML%3A%3AXPath%3A%3ANode/markdown). The constants have the same numeric value as the [XML::DOM](https://www.chedong.com/phpMan.php/perldoc/XML%3A%3ADOM/markdown)
    versions.

  getParentNode
    Returns the parent of this node, or undef if this is the root node. Note that the root node is
    the root node in terms of XPath - not the root element node.

  to_sax ( $handler | %handlers )
    Generates sax calls to the handler or handlers. See the PerlSAX docs for details (not yet
    implemented correctly).

## MORE INFO
    See the sub-classes for the meaning of the rest of the API:

    *   [XML::XPath::Node::Element](https://www.chedong.com/phpMan.php/perldoc/XML%3A%3AXPath%3A%3ANode%3A%3AElement/markdown)

    *   [XML::XPath::Node::Attribute](https://www.chedong.com/phpMan.php/perldoc/XML%3A%3AXPath%3A%3ANode%3A%3AAttribute/markdown)

    *   [XML::XPath::Node::Namespace](https://www.chedong.com/phpMan.php/perldoc/XML%3A%3AXPath%3A%3ANode%3A%3ANamespace/markdown)

    *   [XML::XPath::Node::Text](https://www.chedong.com/phpMan.php/perldoc/XML%3A%3AXPath%3A%3ANode%3A%3AText/markdown)

    *   [XML::XPath::Node::Comment](https://www.chedong.com/phpMan.php/perldoc/XML%3A%3AXPath%3A%3ANode%3A%3AComment/markdown)

    *   [XML::XPath::Node::PI](https://www.chedong.com/phpMan.php/perldoc/XML%3A%3AXPath%3A%3ANode%3A%3API/markdown)

