PrevUpHomeNext

Class node

zeep::xml::node

Synopsis

// In header: </build/libzeep-Vxo1fu/libzeep-3.0.5/zeep/xml/node.hpp>


class node {
public:

  // public member functions
  virtual root_node * root();
  virtual const root_node * root() const;
  virtual std::string lang() const;
  virtual std::string qname() const;
  virtual std::string name() const;
  virtual std::string prefix() const;
  virtual std::string ns() const;
  virtual std::string namespace_for_prefix(const std::string &) const;
  virtual std::string prefix_for_namespace(const std::string &) const;
  virtual std::string str() const = 0;
  virtual void str(const std::string &);
  virtual void 
  write_content(std::ostream &, const char * = kWhiteSpaceChar) const;
  virtual void write(writer &) const = 0;
  virtual bool equals(const node *) const;
  virtual node * clone() const;
  virtual void validate();
};

Description

Node is the abstract base class for all data contained in zeep XML documents. The DOM tree consists of nodes that are linked to each other, each node can have a parent and siblings pointed to by the next and previous members. All nodes in a DOM tree share a common root node.

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. the convenience functions name() and prefix() parse the qname(). ns() returns the namespace URI for the node, if it can be resolved.

Nodes inherit the namespace of their parent unless they override it which means resolving prefixes and namespaces is done hierarchically

node public member functions

  1. virtual root_node * root();
    The root node for this node.
  2. virtual const root_node * root() const;
    The root node for this node.
  3. virtual std::string lang() const;
    content of a xml:lang attribute of this element, or its nearest ancestor
  4. virtual 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.

  5. virtual std::string name() const;
    The name for the node as parsed from the qname.
  6. virtual std::string prefix() const;
    The prefix for the node as parsed from the qname.
  7. virtual std::string ns() const;
    Returns the namespace URI for the node, if it can be resolved.
  8. virtual std::string namespace_for_prefix(const std::string & prefix) const;
    Return the namespace URI for a prefix.
  9. virtual std::string prefix_for_namespace(const std::string & uri) const;
    Return the prefix for a namespace URI.
  10. virtual std::string str() const = 0;
    return all content concatenated, including that of children.
  11. virtual void str(const std::string & value);
    both attribute and element implement str(const string&), others will throw
  12. virtual void 
    write_content(std::ostream & os, const char * sep = kWhiteSpaceChar) const;
    write out the concatenated content to a stream, separated by sep.
  13. virtual void write(writer & w) const = 0;
    writing out
  14. virtual bool equals(const node * n) const;
    Compare the node with n.
  15. virtual node * clone() const;
    Deep clone the node.
  16. virtual void validate();
    debug routine

PrevUpHomeNext