cpp-ElementTree
Python ElementTree-alike XML API for C++
Functions
etree::html Namespace Reference

ElementTree HTML namespace; public classes and functions are defined here. More...

Functions

Element fromstring (const std::string &s)
 Parse an HTML document from a STL string and return a reference to its root node. More...
 
Element fromstring (const char *s)
 Parse an HTML document from a character array and return a reference to its root node. More...
 
ElementTree parse (const std::string &path)
 Parse an HTML document from the filesystem and return it. More...
 
ElementTree parse (std::istream &is)
 Parse an HTML document from a STL istream and return it. More...
 
ElementTree parse (int fd)
 Parse an HTML document from a file descriptor and return it. More...
 
std::string tostring (const Element &e)
 Serialize an HTML element. More...
 

Detailed Description

ElementTree HTML namespace; public classes and functions are defined here.

Function Documentation

Element etree::html::fromstring ( const std::string &  s)

Parse an HTML document from a STL string and return a reference to its root node.

Parameters
sDocument fragment as a string.
Returns
Root Element.
Element etree::html::fromstring ( const char *  s)

Parse an HTML document from a character array and return a reference to its root node.

Parameters
sDocument fragment as a string.
Returns
Root Element.
ElementTree etree::html::parse ( const std::string &  path)

Parse an HTML document from the filesystem and return it.

Parameters
pathPath to file.
Returns
ElementTree instance.
ElementTree etree::html::parse ( std::istream &  is)

Parse an HTML document from a STL istream and return it.

Parameters
isInput stream.
Returns
ElementTree instance.
ElementTree etree::html::parse ( int  fd)

Parse an HTML document from a file descriptor and return it.

Parameters
fdFile descriptor number.
Returns
ElementTree instance.
std::string etree::html::tostring ( const Element e)

Serialize an HTML element.

See ElementTree::tostring() for another variant.

Parameters
eElement to serialize.
Returns
UTF-8 encoded string.

Serialize an HTML element.

See ElementTree::tostring() for another variant.

Parameters
eElement to serialize.
Returns
UTF-8 encoded string.