---
name: "XML::XPath::Node"
section: "3pm"
platform: "linux"
package: "perl-xml-xpath"
version: "1.49-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/XML::XPath::Node"
---

# XML::XPath::Node(3pm)

internal representation of a node

## NAME

XML::XPath::Node - 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 programming to XML::XPath. Compatibility with DOM may arise once XML::DOM 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. The constants have the same numeric value as the XML::DOM 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

- •

  XML::XPath::Node::Attribute

- •

  XML::XPath::Node::Namespace

- •

  XML::XPath::Node::Text

- •

  XML::XPath::Node::Comment

- •

  XML::XPath::Node::PI
