Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

xmlpp::Parser Class Reference

XML parser. More...

Inheritance diagram for xmlpp::Parser:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 Parser ()
virtual ~Parser ()
virtual void set_validate (bool val=true)
 By default, the parser will not validate the XML file.

virtual bool get_validate () const
 See set_validate().

virtual void set_substitute_entities (bool val=true)
 Set whether the parser will automatically substitute entity references with the text of the entities' definitions.

virtual bool get_substitute_entities () const
 See set_substitute_entities().

virtual void parse_file (const std::string &filename)=0
 Parse an XML document from a file.

virtual void parse_memory (const std::string &contents)=0
 Parse an XML document from a string.

virtual void parse_stream (std::istream &in)=0
 Parse an XML document from a stream.


Protected Member Functions

virtual void initialize_context ()
virtual void release_underlying ()
virtual void on_validity_error (const std::string &message)
virtual void on_validity_warning (const std::string &message)
virtual void handleException (const exception &e)
virtual void check_for_exception ()
virtual void check_for_validity_messages ()

Static Protected Member Functions

void callback_validity_error (void *ctx, const char *msg,...)
void callback_validity_warning (void *ctx, const char *msg,...)

Protected Attributes

_xmlParserCtxt * context_
exceptionexception_
std::string validate_error_
std::string validate_warning_
bool validate_
bool substitute_entities_

Detailed Description

XML parser.


Constructor & Destructor Documentation

xmlpp::Parser::Parser  ) 
 

virtual xmlpp::Parser::~Parser  )  [virtual]
 


Member Function Documentation

void xmlpp::Parser::callback_validity_error void *  ctx,
const char *  msg,
... 
[static, protected]
 

void xmlpp::Parser::callback_validity_warning void *  ctx,
const char *  msg,
... 
[static, protected]
 

virtual void xmlpp::Parser::check_for_exception  )  [protected, virtual]
 

virtual void xmlpp::Parser::check_for_validity_messages  )  [protected, virtual]
 

virtual bool xmlpp::Parser::get_substitute_entities  )  const [virtual]
 

See set_substitute_entities().

Returns:
Whether entities will be substituted during parsing.

virtual bool xmlpp::Parser::get_validate  )  const [virtual]
 

See set_validate().

Returns:
Whether the parser will validate the XML file.

virtual void xmlpp::Parser::handleException const exception e  )  [protected, virtual]
 

virtual void xmlpp::Parser::initialize_context  )  [protected, virtual]
 

virtual void xmlpp::Parser::on_validity_error const std::string &  message  )  [protected, virtual]
 

virtual void xmlpp::Parser::on_validity_warning const std::string &  message  )  [protected, virtual]
 

virtual void xmlpp::Parser::parse_file const std::string &  filename  )  [pure virtual]
 

Parse an XML document from a file.

Exceptions:
exception 
Parameters:
filename The path to the file.

Implemented in xmlpp::DomParser, and xmlpp::SaxParser.

virtual void xmlpp::Parser::parse_memory const std::string &  contents  )  [pure virtual]
 

Parse an XML document from a string.

Exceptions:
exception 
Parameters:
contents The XML document as a string.

Implemented in xmlpp::DomParser, and xmlpp::SaxParser.

virtual void xmlpp::Parser::parse_stream std::istream &  in  )  [pure virtual]
 

Parse an XML document from a stream.

Exceptions:
exception 
Parameters:
in The stream.

Implemented in xmlpp::DomParser, and xmlpp::SaxParser.

virtual void xmlpp::Parser::release_underlying  )  [protected, virtual]
 

Reimplemented in xmlpp::DomParser, and xmlpp::SaxParser.

virtual void xmlpp::Parser::set_substitute_entities bool  val = true  )  [virtual]
 

Set whether the parser will automatically substitute entity references with the text of the entities' definitions.

For instance, this affects the text returned by ContentNode::get_content(). By default, the parser will not substitute entities, so that you do not lose the entity reference information.

Parameters:
val Whether entities will be substitued.

virtual void xmlpp::Parser::set_validate bool  val = true  )  [virtual]
 

By default, the parser will not validate the XML file.

Parameters:
val Whether the document should be validated.


Member Data Documentation

_xmlParserCtxt* xmlpp::Parser::context_ [protected]
 

exception* xmlpp::Parser::exception_ [protected]
 

bool xmlpp::Parser::substitute_entities_ [protected]
 

bool xmlpp::Parser::validate_ [protected]
 

std::string xmlpp::Parser::validate_error_ [protected]
 

std::string xmlpp::Parser::validate_warning_ [protected]
 


The documentation for this class was generated from the following file:
Generated on Wed May 5 22:52:45 2004 for libxml++ by doxygen 1.3.5