|
libxml++
2.35.3
|
Represents an XML document in the DOM model. More...
#include <libxml++/document.h>


Classes | |
| class | Init |
Public Member Functions | |
| Document (const Glib::ustring& version="1.0") | |
| virtual | ~Document () |
| Glib::ustring | get_encoding () const |
| Dtd* | get_internal_subset () const |
| void | set_internal_subset (const Glib::ustring& name, const Glib::ustring& external_id, const Glib::ustring& system_id) |
| Element* | get_root_node () const |
| Return the root node. | |
| Element* | create_root_node (const Glib::ustring& name, const Glib::ustring& ns_uri=Glib::ustring(), const Glib::ustring& ns_prefix=Glib::ustring()) |
| Creates the root node. | |
| Element* | create_root_node_by_import (const Node* node, bool recursive=true) |
| Creates a root node by importing the node from another document, without affecting the source node. | |
| CommentNode* | add_comment (const Glib::ustring& content) |
| Append a new comment node. | |
| ProcessingInstructionNode* | add_processing_instruction (const Glib::ustring& name, const Glib::ustring& content) |
| Append a new processing instruction node. | |
| void | write_to_file (const Glib::ustring& filename, const Glib::ustring& encoding=Glib::ustring()) |
| Write the document to a file. | |
| void | write_to_file_formatted (const Glib::ustring& filename, const Glib::ustring& encoding=Glib::ustring()) |
| Write the document to a file. | |
| Glib::ustring | write_to_string (const Glib::ustring& encoding=Glib::ustring()) |
| Write the document to the memory. | |
| Glib::ustring | write_to_string_formatted (const Glib::ustring& encoding=Glib::ustring()) |
| Write the document to the memory. | |
| void | write_to_stream (std::ostream& output, const Glib::ustring& encoding=Glib::ustring()) |
| Write the document to a std::ostream. | |
| void | write_to_stream_formatted (std::ostream& output, const Glib::ustring& encoding=Glib::ustring()) |
| Write the document to a std::ostream. | |
| virtual void | set_entity_declaration (const Glib::ustring& name, XmlEntityType type, const Glib::ustring& publicId, const Glib::ustring& systemId, const Glib::ustring& content) |
| Add an Entity declaration to the document. | |
| _xmlDoc* | cobj () |
| Access the underlying libxml implementation. | |
| const _xmlDoc* | cobj () const |
| Access the underlying libxml implementation. | |
Protected Member Functions | |
| Document (_xmlDoc* doc) | |
| _xmlEntity* | get_entity (const Glib::ustring& name) |
| Retrieve an Entity. | |
Represents an XML document in the DOM model.
| xmlpp::Document::Document | ( | const Glib::ustring & | version = "1.0" | ) | [explicit] |
| xmlpp::Document::Document | ( | _xmlDoc * | doc | ) | [protected] |
| virtual xmlpp::Document::~Document | ( | ) | [virtual] |
| CommentNode* xmlpp::Document::add_comment | ( | const Glib::ustring & | content | ) |
Append a new comment node.
| content | The text. This should be unescaped - see ContentNode::set_content(). |
| ProcessingInstructionNode* xmlpp::Document::add_processing_instruction | ( | const Glib::ustring & | name, |
| const Glib::ustring & | content | ||
| ) |
Append a new processing instruction node.
| name | The name of the application to which the instruction is directed. |
| content | The content of the instruction. This should be unescaped - see ContentNode::set_content(). |
| internal_error |
| _xmlDoc* xmlpp::Document::cobj | ( | ) |
Access the underlying libxml implementation.
| const _xmlDoc* xmlpp::Document::cobj | ( | ) | const |
Access the underlying libxml implementation.
| Element* xmlpp::Document::create_root_node | ( | const Glib::ustring & | name, |
| const Glib::ustring & | ns_uri = Glib::ustring(), |
||
| const Glib::ustring & | ns_prefix = Glib::ustring() |
||
| ) |
Creates the root node.
| name | The node's name. |
| ns_uri | The namespace URI. A namespace declaration will be added to this node, because it could not have been declared before. |
| ns_prefix | The namespace prefix to associate with the namespace. If no namespace prefix is specified then the namespace URI will be the default namespace. |
Creates a root node by importing the node from another document, without affecting the source node.
| node | The node to copy and insert as the root node of the document |
| recursive | Whether to import the child nodes also. Defaults to true. |
| Glib::ustring xmlpp::Document::get_encoding | ( | ) | const |
| _xmlEntity* xmlpp::Document::get_entity | ( | const Glib::ustring & | name | ) | [protected] |
Retrieve an Entity.
The entity can be from an external subset or internally declared.
| name | The name of the entity to get. |
| Dtd* xmlpp::Document::get_internal_subset | ( | ) | const |
| Element* xmlpp::Document::get_root_node | ( | ) | const |
Return the root node.
This function does _not_ create a default root node if it doesn't exist.
| virtual void xmlpp::Document::set_entity_declaration | ( | const Glib::ustring & | name, |
| XmlEntityType | type, | ||
| const Glib::ustring & | publicId, | ||
| const Glib::ustring & | systemId, | ||
| const Glib::ustring & | content | ||
| ) | [virtual] |
Add an Entity declaration to the document.
| name | The name of the entity that will be used in an entity reference. |
| type | The type of entity. |
| publicId | The public ID of the subset. |
| systemId | The system ID of the subset. |
| content | The value of the Entity. In entity reference substitutions, this is the replacement value. |
| void xmlpp::Document::set_internal_subset | ( | const Glib::ustring & | name, |
| const Glib::ustring & | external_id, | ||
| const Glib::ustring & | system_id | ||
| ) |
| void xmlpp::Document::write_to_file | ( | const Glib::ustring & | filename, |
| const Glib::ustring & | encoding = Glib::ustring() |
||
| ) |
Write the document to a file.
| filename | |
| encoding | If not provided, UTF-8 is used |
| void xmlpp::Document::write_to_file_formatted | ( | const Glib::ustring & | filename, |
| const Glib::ustring & | encoding = Glib::ustring() |
||
| ) |
Write the document to a file.
The output is formatted by inserting whitespaces, which is easier to read for a human, but may insert unwanted significant whitespaces. Use with care !
| filename | |
| encoding | If not provided, UTF-8 is used |
| void xmlpp::Document::write_to_stream | ( | std::ostream & | output, |
| const Glib::ustring & | encoding = Glib::ustring() |
||
| ) |
Write the document to a std::ostream.
| output | A reference to the stream in which the document will be written |
| encoding | If not provided, UTF-8 is used |
| void xmlpp::Document::write_to_stream_formatted | ( | std::ostream & | output, |
| const Glib::ustring & | encoding = Glib::ustring() |
||
| ) |
Write the document to a std::ostream.
The output is formatted by inserting whitespaces, which is easier to read for a human, but may insert unwanted significant whitespaces. Use with care !
| output | A reference to the stream in which the document will be written |
| encoding | If not provided, UTF-8 is used |
| Glib::ustring xmlpp::Document::write_to_string | ( | const Glib::ustring & | encoding = Glib::ustring() | ) |
Write the document to the memory.
| encoding | If not provided, UTF-8 is used |
| Glib::ustring xmlpp::Document::write_to_string_formatted | ( | const Glib::ustring & | encoding = Glib::ustring() | ) |
Write the document to the memory.
The output is formatted by inserting whitespaces, which is easier to read for a human, but may insert unwanted significant whitespaces. Use with care !
| encoding | If not provided, UTF-8 is used |
1.7.5