XML::XPath::Node(3)

πŸ’– XML::XPath::Node πŸ’–

okay bestie, so this is XML::XPath::Node β€” it's the internal representation of a node, straight out of the User Contributed Perl Documentation section of the manual. yes it's giving "under the hood" energy and we're obsessed πŸŽ€


✨ API ✨

The Node API is lowkey trying to emulate DOM, but ngl it isn't quite compatible with DOM. the whole point is to ease the transition from XML::DOM programming over to XML::XPath. and the tea is: compatibility with DOM may arise once XML::DOM gets namespace support. until then, we vibe with what we have πŸ’…

🌸 new

Creates a new node. See the sub-classes for the parameters you pass to new() β€” they're the ones holding the receipts 🫢

🌸 getNodeType

Returns one of ELEMENT_NODE, TEXT_NODE, COMMENT_NODE, ATTRIBUTE_NODE, PROCESSING_INSTRUCTION_NODE or NAMESPACE_NODE.

UNKNOWN_NODE gets returned if the sub-class doesn't implement getNodeType β€” but bestie, that means something is broken! 😭

The constants are exported by default from XML::XPath::Node, and they have the same numeric value as the XML::DOM versions. matching numbers, matching energy, periodt ✨

🌸 getParentNode

Returns the parent of this node, or undef if this is the root node.

⚠️ note that the root node here is the root node in terms of XPath β€” not the root element node. iykyk, don't get it twisted πŸ‘‘

🌸 to_sax ( $handler | %handlers )

Generates sax calls to the handler or handlers. See the PerlSAX docs for details.

πŸ™ˆ heads up: this one is not yet implemented correctly. we're being honest about it, fr fr.

πŸ¦‹ MORE INFO πŸ¦‹

See the sub-classes for the meaning of the rest of the API β€” they're the main characters here:

  • XML::XPath::Node::Element
  • XML::XPath::Node::Attribute
  • XML::XPath::Node::Namespace
  • XML::XPath::Node::Text
  • XML::XPath::Node::Comment
  • XML::XPath::Node::PI

and that's the whole page, bestie! this lil gem is from perl v5.42.1, dated 2026-04-21 β€” shoutout to the User Contributed Perl Documentation crew for keeping the vibes immaculate. slay, bye! πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from