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
- Getting Started / Example
- Quickstart / Accessing document data
- Manual / 8.1. XPath types
- Manual / 8.2. Selecting nodes via XPath expression
- Manual / 8.3. Using query objects
- Manual / 8.4. Using variables
- Manual / v1.0 2010-11-01
- Manual / v0.5 2009-11-08
- Manual / 10.5. Classes
- Samples / xpath_select
Methods
xpath_node overload | Default constructor; constructs empty XPath node. | |
xpath_node overload | Construct XPath node from XML node/attribute. | |
attribute | ||
node | Get node/attribute, if any. | |
operator unspecified_bool_type | Safe bool conversion operator. | |
operator! | Borland C++ workaround. | |
operator!= | ||
operator== | Comparison operators. | |
parent | Get 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;
};