pugixml.pugi.XPathNode

class pugixml.pugi.XPathNode

Bases: pybind11_object

XPath node class (either XMLNode or XMLAttribute).

Methods

__bool__(self)

Determine if this XPath node is not empty.

__eq__(*args, **kwargs)

Overloaded function.

__hash__

__init__(*args, **kwargs)

Overloaded function.

__ne__(*args, **kwargs)

Overloaded function.

attribute(self)

Return the attribute if exists.

node(self)

Return the node if exists.

parent(self)

Return the parent node.

Member Documentation

__bool__(self: pugixml.pugi.XPathNode) bool

Determine if this XPath node is not empty.

Returns:

True if the XPath node is not empty, False otherwise.

__eq__(*args, **kwargs)

Overloaded function.

  1. __eq__(self: pugixml.pugi.XPathNode, other: pugixml.pugi.XPathNode) -> bool

    Return self == other.

  2. __eq__(self: pugixml.pugi.XPathNode, other: pugixml.pugi.XMLNode) -> bool

    Return self == other.

Parameters:

other – The node to compare.

Returns:

True if the internal objects are the same, False otherwise.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pugixml.pugi.XPathNode) -> None

    Initialize XPathNode as an empty XPath node.

  2. __init__(self: pugixml.pugi.XPathNode, node: pugixml.pugi.XMLNode) -> None

    Initialize XPathNode with the node.

  3. __init__(self: pugixml.pugi.XPathNode, attribute: pugixml.pugi.XMLAttribute, parent: pugixml.pugi.XMLNode) -> None

    Initialize XPathNode with the attribute and its parent node.

Parameters:
  • node – The node to evaluate over.

  • attribute – The attribute to evaluate over.

  • parent – The parent node of attribute.

__ne__(*args, **kwargs)

Overloaded function.

  1. __ne__(self: pugixml.pugi.XPathNode, other: pugixml.pugi.XPathNode) -> bool

    Return self != other.

  2. __ne__(self: pugixml.pugi.XPathNode, other: pugixml.pugi.XMLNode) -> bool

    Return self != other.

Parameters:

other – The node to compare.

Returns:

True if the internal objects are not the same, False otherwise.

attribute(self: pugixml.pugi.XPathNode) pugixml.pugi.XMLAttribute

Return the attribute if exists.

Returns:

The attribute if exists, or an empty attribute otherwise.

node(self: pugixml.pugi.XPathNode) pugixml.pugi.XMLNode

Return the node if exists.

Returns:

The node if exists, or an empty node otherwise.

parent(self: pugixml.pugi.XPathNode) pugixml.pugi.XMLNode

Return the parent node.

Returns:

The parent of node.