PrevUpHomeNext

Class attribute

zeep::xml::attribute — An attribute is a node, has an element as parent, but is not a child of this parent (!)

Synopsis

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


class attribute : public zeep::xml::node {
public:
  // construct/copy/destruct
  attribute(const std::string &, const std::string &, bool = false);

  // public member functions
  std::string qname() const;
  std::string value() const;
  void value(const std::string &);
  std::string str() const;
  void write(writer &) const;
  bool equals(const node *) const;
  node * clone() const;
  bool id() const;
};

Description

attribute public construct/copy/destruct

  1. attribute(const std::string & qname, const std::string & value, 
              bool id = false);

attribute public member functions

  1. std::string qname() const;

    Nodes can have a name, and the XPath specification requires that a node can have a so-called expanded-name. This name consists of a local-name and a namespace which is a URI. And we can have a QName which is a concatenation of a prefix (that points to a namespace URI) and a local-name separated by a colon.

    To reduce storage requirements, names are stored in nodes as qnames, if at all.

  2. std::string value() const;
  3. void value(const std::string & v);
  4. std::string str() const;
    return all content concatenated, including that of children.
  5. void write(writer & w) const;
    writing out
  6. bool equals(const node * n) const;
    Compare the node with n.
  7. node * clone() const;
    Deep clone the node.
  8. bool id() const;

PrevUpHomeNext