Class xpath_node

Synopsis

#include <src/pugixml.hpp>

class PUGIXML_CLASS xpath_node

Description

XPath node class (either xml_node or xml_attribute)

Mentioned in

Methods

xpath_node overloadDefault constructor; constructs empty XPath node.
xpath_node overloadConstruct XPath node from XML node/attribute.
attribute
nodeGet node/attribute, if any.
operator unspecified_bool_typeSafe bool conversion operator.
operator!Borland C++ workaround.
operator!=
operator==Comparison operators.
parentGet parent of contained node/attribute.

Source

Lines 1311-1343 in src/pugixml.hpp.

class PUGIXML_CLASS xpath_node
{
private:
    xml_node _node;
    xml_attribute _attribute;
    typedef void (*unspecified_bool_type)(xpath_node***);
public:
    // Default constructor; constructs empty XPath node
    xpath_node();
    // Construct XPath node from XML node/attribute
    xpath_node(const xml_node& node);
    xpath_node(const xml_attribute& attribute, const xml_node& parent);
    // Get node/attribute, if any
    xml_node node() const;
    xml_attribute attribute() const;
    // Get parent of contained node/attribute
    xml_node parent() const;
    // Safe bool conversion operator
    operator unspecified_bool_type() const;
    // Borland C++ workaround
    bool operator!() const;
    // Comparison operators
    bool operator==(const xpath_node& n) const;
    bool operator!=(const xpath_node& n) const;
};





Add Discussion as Guest

Log in