#include <doc.h>
Public Member Functions | |
Document () | |
Default ctor. | |
Document (const Node::Ref &ref) throw (Exception) | |
Construct a Dv::Xml::Document out of a (copy of a) Dv::Xml::Node object. | |
Document (const Dv::Util::File &file) throw (Exception) | |
Parse a Dv::Xml::Document from a file. | |
Document (const std::string &name, const std::string &content) throw (Exception) | |
Create a Dv::Xml::Document with a root labeled with given name and content. | |
Document (const std::string &name) throw (Exception) | |
Create a Dv::Xml::Document with a root labeled with given name. | |
Document (const char *pc, size_t size) throw (Exception) | |
Parse a Dv::Xml::Document from an array of characters . | |
Document (const std::string &stylesheet, Document &doc) throw (Exception) | |
Create a Dv::Xml::Document by applying an XSLT stylesheet to another Document. | |
virtual | ~Document () |
Destructor. | |
Document & | parse (const char *data, size_t size) throw (Exception) |
Parse a Dv::Xml::Document from an array of characters . | |
Document & | parse (const std::string &filenm) throw (Exception) |
Parse a Dv::Xml::Document from a filenm. | |
Document & | operator= (const Node::Ref &ref) throw (Exception) |
Set root. | |
void | root (const Node::Ref &ref) throw (Exception) |
Set root. | |
Node::Ref | root () const |
Get root Dv::Xml::Node of Document. | |
operator Node::Ref () const | |
Convert to reference to root of document. | |
const std::string & | encoding () const |
Get encoding of Document. | |
Document & | encoding (const std::string &enc) |
Set encoding of Document. | |
bool | valid (const std::string &dtd="") |
Validate document w.r.t. | |
Node::Ref | select (const std::string &path) const throw (Exception) |
Select node after path from document. | |
std::string & | apply (const std::string &stylesheet, std::string &s) throw (Exception) |
Apply an XSLT stylesheet to this Document. | |
std::string | apply (const std::string &stylesheet) throw (Exception) |
Apply an XSLT stylesheet to this Document. |
Definition at line 18 of file doc.h.
Dv::Xml::Document::Document | ( | ) | [explicit] |
Default ctor.
Construct a Dv::Xml::Document out of a (copy of a) Dv::Xml::Node object.
ref | Dv::Xml::Node::Ref, a copy of which will be used as the root of the new Dv::Xml::Document object. |
Dv::Xml::Exception | if node is not valid. |
Dv::Xml::Document::Document | ( | const Dv::Util::File & | file | ) | throw (Exception) [explicit] |
Parse a Dv::Xml::Document from a file.
file | containing document |
Dv::Xml::Exception | upon any error |
Dv::Xml::Document::Document | ( | const std::string & | name, | |
const std::string & | content | |||
) | throw (Exception) [explicit] |
Create a Dv::Xml::Document with a root labeled with given name and content.
name | to be used as the label of the root of the document | |
content | to be used as the content of the root of the document |
Dv::Xml::Exception | upon any error |
Dv::Xml::Document::Document | ( | const std::string & | name | ) | throw (Exception) [explicit] |
Create a Dv::Xml::Document with a root labeled with given name.
name | to be used as the label of the root of the document |
Dv::Xml::Exception | upon any error |
Dv::Xml::Document::Document | ( | const char * | pc, | |
size_t | size | |||
) | throw (Exception) [explicit] |
Parse a Dv::Xml::Document from an array of characters .
pc | pointer to the start of the data | |
size | of the data array |
Dv::Xml::Exception | upon any error |
Dv::Xml::Document::Document | ( | const std::string & | stylesheet, | |
Document & | doc | |||
) | throw (Exception) [explicit] |
Create a Dv::Xml::Document by applying an XSLT stylesheet to another Document.
stylesheet | filename of xslt file | |
doc | input document |
Dv::Xml::Exception | upon any error |
virtual Dv::Xml::Document::~Document | ( | ) | [virtual] |
Destructor.
Parse a Dv::Xml::Document from an array of characters .
The result replaces the current contents of this document.
data | pointer to the start of the data | |
size | of the data array |
Dv::Xml::Exception | upon any error |
Parse a Dv::Xml::Document from a filenm.
The result replaces the current contents of this document.
filenm | name of file where document can be found. |
Dv::Xml::Exception | upon any error |
Set root.
ref | reference to node to copy to root of this document. |
Dv::Xml::Exception | if ref does not refer to a valid xml::node. |
Set root.
ref | reference to node that will be copied to the root of this document. |
Dv::Xml::Exception | if node is not valid. |
Node::Ref Dv::Xml::Document::root | ( | ) | const |
Get root Dv::Xml::Node of Document.
Dv::Xml::Document doc; .. (doc.root() >> "child" >> "grandchild")["name"] = "Pete";
Referenced by operator Node::Ref().
Dv::Xml::Document::operator Node::Ref | ( | ) | const [inline] |
Convert to reference to root of document.
Definition at line 119 of file doc.h.
References root().
const std::string& Dv::Xml::Document::encoding | ( | ) | const [inline] |
Document& Dv::Xml::Document::encoding | ( | const std::string & | enc | ) | [inline] |
bool Dv::Xml::Document::valid | ( | const std::string & | dtd = "" |
) |
Validate document w.r.t.
DTD.
dtd | url or filename of DTD, if empty, the dtd is assumed to have been included in the document. |
Select node after path from document.
path | of the form "a/b/c" |
Dv::Xml::Exception | if node is not valid. |
std::string& Dv::Xml::Document::apply | ( | const std::string & | stylesheet, | |
std::string & | s | |||
) | throw (Exception) |
Apply an XSLT stylesheet to this Document.
The result is immediately serialised in a string (useful e.g. when the "omit-xml-declaration" option is used.
stylesheet | filename of xslt file | |
s | string that will contain the result of the XSL transform. |
Dv::Xml::Exception | upon any error |
std::string Dv::Xml::Document::apply | ( | const std::string & | stylesheet | ) | throw (Exception) [inline] |
Apply an XSLT stylesheet to this Document.
The result is immediately serialised in a string (useful e.g. when the "omit-xml-declaration" option is used.
stylesheet | filename of xslt file |
Dv::Xml::Exception | upon any error |
dvxml-0.1.7 | [ 7 January, 2008] |