ElementTree namespace; public classes and functions are defined here.
More...
|
| feed |
| RSS/ATOM feed parser implementation.
|
|
| html |
| ElementTree HTML namespace; public classes and functions are defined here.
|
|
|
typedef std::vector< std::pair< std::string, std::string > > | ns_list |
| Represent a list of namespaces and their associated prefixes that should be defined while executing an XPath expression.
|
|
typedef Nullable< Element > | NullableElement |
| Convenient alias for Nullable<Element> to avoid typing "etree::" twice in scopes that do not import Nullable and Element.
|
|
ElementTree namespace; public classes and functions are defined here.
Element etree::fromstring |
( |
const char * |
s, |
|
|
size_t |
n = 0 |
|
) |
| |
Parse an XML document from a character array and return a reference to its root node.
- Parameters
-
s | XML document as a string. |
n | Number of bytes to consume. If zero, assumes s is NUL-terminated. |
- Returns
- Root Element.
std::ostream& etree::operator<< |
( |
std::ostream & |
out, |
|
|
const ElementTree & |
elem |
|
) |
| |
Generate a human-readable description of an element tree.
- Parameters
-
out | ostream to write description to. |
elem | Object to describe. |
- Returns
- ostream.
std::ostream& etree::operator<< |
( |
std::ostream & |
out, |
|
|
const Element & |
elem |
|
) |
| |
Generate a human-readable description of an element.
- Parameters
-
out | ostream to write description to. |
elem | Object to describe. |
- Returns
- ostream.
std::ostream& etree::operator<< |
( |
std::ostream & |
out, |
|
|
const QName & |
qname |
|
) |
| |
Generate a human-readable description of a QName.
- Parameters
-
out | ostream to write description to. |
qname | Object to describe. |
- Returns
- ostream.
Parse an XML document from a STL istream and return it.
- Parameters
-
- Returns
- ElementTree instance.
Parse an XML document from the filesystem and return it.
- Parameters
-
- Returns
- ElementTree instance.
Parse an XML document from a file descriptor and return it.
- Parameters
-
fd | File descriptor number. |
- Returns
- ElementTree instance.
Construct a new child element.
- Parameters
-
parent | Parent element. |
qname | New element name. |
- Returns
- New element.
C++11: append a new child to an element and return it, taking the child's attributes from an initializer list.
- Parameters
-
parent | Parent element. |
qname | New element name. |
attribs | List of attribute name-value pairs from initialization list. |
- Returns
- New element.
string etree::tostring |
( |
const Element & |
e | ) |
|
Serialize an element.
Serialize an HTML element.
See ElementTree::tostring() for another variant.
- Parameters
-
- Returns
- UTF-8 encoded string.
Serialize a tree.
See ElementTree::tostring() for another variant.
- Parameters
-
- Returns
- UTF-8 encoded string.
template<typename Function >
void etree::visit |
( |
Element |
elem, |
|
|
Function |
func |
|
) |
| |
Depth-first visit an element and all of its subelements.
- Parameters
-
elem | Element to visit. |
func | Function called as (void)func(Element&); |