Inheritance diagram for xmlpp::SaxParser:
Public Types | |
typedef std::deque< Attribute > | AttributeList |
Public Member Functions | |
SaxParser (bool use_get_entity=false) | |
virtual | ~SaxParser () |
virtual void | parse_file (const std::string &filename) |
Parse an XML document from a file. | |
virtual void | parse_memory (const std::string &contents) |
Parse an XML document from a string. | |
virtual void | parse_stream (std::istream &in) |
Parse an XML document from a stream. | |
virtual void | parse_chunk (const std::string &chunk) |
Parse a chunk of data. | |
virtual void | finish_chunk_parsing () |
Finish a chunk-wise parse. | |
Protected Member Functions | |
virtual void | on_start_document () |
virtual void | on_end_document () |
virtual void | on_start_element (const std::string &name, const AttributeList &attributes) |
virtual void | on_end_element (const std::string &name) |
virtual void | on_characters (const std::string &characters) |
virtual void | on_comment (const std::string &text) |
virtual void | on_warning (const std::string &text) |
virtual void | on_error (const std::string &text) |
virtual void | on_fatal_error (const std::string &text) |
virtual void | on_cdata_block (const std::string &text) |
virtual void | on_internal_subset (const std::string &name, const std::string &publicId, const std::string &systemId) |
Override this to receive information about the document's DTD and any entity declarations. | |
virtual _xmlEntity * | on_get_entity (const std::string &name) |
Override this method to resolve entities references in your derived parser, instead of using the default entity resolution, or to be informed when entity references are encountered. | |
virtual void | on_entity_declaration (const std::string &name, XmlEntityType type, const std::string &publicId, const std::string &systemId, const std::string &content) |
Override this to receive information about every entity declaration. | |
virtual void | release_underlying () |
Friends | |
struct | SaxParserCallback |
Derive your own class and override the on_*() methods.
|
|
|
|
|
|
|
Finish a chunk-wise parse. Call this after the last call to parse_chunk(). Don't use this function with the other parsing methods. |
|
|
|
|
|
|
|
|
|
|
|
Override this to receive information about every entity declaration. If you override this function, and you want normal entity substitution to work, then you must call the base class in your override. This would be useful when overriding on_get_entity(). |
|
|
|
|
|
Override this method to resolve entities references in your derived parser, instead of using the default entity resolution, or to be informed when entity references are encountered. If you override this function then you must also specify true for use_get_entity constructor parameter. You will probably need to override on_entity_declaration() as well so that you can use that information when resolving the entity reference. This is known to be difficult, because it requires both an understanding of the W3C specifications and knowledge of the libxml internals. Entity resolution is easier with the DomParser. Call this method in this base class for default processing. For instance, if you just want to know about the existence of an entity reference, without affecting the normal substitution, just override and call the base class. Unlike the DomParser, the SaxParser will also tell you about entity references for the 5 predefined entities.
|
|
Override this to receive information about the document's DTD and any entity declarations.
|
|
|
|
|
|
|
|
Parse a chunk of data. This lets you pass a document in small chunks, e.g. from a network connection. The on_* virtual functions are called each time the chunks provide enough information to advance the parser. The first call to parse_chunk will setup the parser. When the last chunk has been parsed, call finish_chunk_parsing() to finish the parse.
|
|
Parse an XML document from a file.
Implements xmlpp::Parser. |
|
Parse an XML document from a string.
Implements xmlpp::Parser. |
|
Parse an XML document from a stream.
Implements xmlpp::Parser. |
|
Reimplemented from xmlpp::Parser. |
|
|