PrevUpHome

Class xpath

zeep::xml::xpath

Synopsis

// In header: </home/maarten/projects/libzeep/zeep/xml/xpath.hpp>


class xpath {
public:
  // construct/copy/destruct
  xpath(const std::string &);

  // public member functions
  template<typename NODE_TYPE> 
    std::list< NODE_TYPE * > evaluate(const node &) const;
  template<typename NODE_TYPE> 
    std::list< NODE_TYPE * > evaluate(const node &, context &) const;
};

Description

The actual xpath implementation. It expects an xpath in the constructor and this path _must_ be UTF-8 encoded.

xpath public construct/copy/destruct

  1. xpath(const std::string & path);

xpath public member functions

  1. template<typename NODE_TYPE> 
      std::list< NODE_TYPE * > evaluate(const node & root) const;

    evaluate returns a node_set. If you're only interested in zeep::xml::element results, you should call the evaluate<element>() instantiation.

  2. template<typename NODE_TYPE> 
      std::list< NODE_TYPE * > evaluate(const node & root, context & ctxt) const;
    The second evaluate method is used for xpaths that contain variables.

PrevUpHome