mirror of
https://github.com/jezhiggins/arabica
synced 2025-01-29 08:36:45 +01:00
Promoted LexicalHandler and DeclHandler to be full members of XMLReader, rather than properties set via the rather tortuous setProperty call. XMLFilter and XMLFilterImpl have been extended to provide support for Lexical~ and DeclHandler. DefaultHandler now provides default, do nothing, implementations of Lexical~ and DeclHandler. Consequently DefaultHandler2 is now deprecated and will be removed in due course.
Merged from mangle branch.
This commit is contained in:
parent
c452b5ba91
commit
0b178c17a7
8 changed files with 424 additions and 286 deletions
|
@ -14,8 +14,11 @@
|
|||
#include <SAX/DTDHandler.h>
|
||||
#include <SAX/ErrorHandler.h>
|
||||
#include <SAX/InputSource.h>
|
||||
#include <SAX/ext/LexicalHandler.h>
|
||||
#include <SAX/ext/DeclHandler.h>
|
||||
#include <SAX/SAXNotSupportedException.h>
|
||||
|
||||
|
||||
namespace SAX
|
||||
{
|
||||
|
||||
|
@ -66,6 +69,8 @@ public:
|
|||
typedef basic_ContentHandler<stringT> ContentHandlerT;
|
||||
typedef basic_InputSource<stringT> InputSourceT;
|
||||
typedef basic_ErrorHandler<stringT> ErrorHandlerT;
|
||||
typedef basic_DeclHandler<stringT> DeclHandlerT;
|
||||
typedef basic_LexicalHandler<stringT> LexicalHandlerT;
|
||||
|
||||
virtual ~basic_XMLReader() { }
|
||||
|
||||
|
@ -251,6 +256,24 @@ public:
|
|||
*/
|
||||
virtual ErrorHandlerT* getErrorHandler() const = 0;
|
||||
|
||||
virtual void setDeclHandler(DeclHandlerT& handler) = 0;
|
||||
/**
|
||||
* Return the current decl handler.
|
||||
*
|
||||
* @return The current decl handler, or 0 if none has been registered
|
||||
* @see #setDeclHandler
|
||||
*/
|
||||
virtual DeclHandlerT* getDeclHandler() const = 0;
|
||||
|
||||
virtual void setLexicalHandler(LexicalHandlerT& handler) = 0;
|
||||
/**
|
||||
* Return the current lexical handler.
|
||||
*
|
||||
* @return The current lexical handler, or 0 if none has been registered
|
||||
* @see #setLexicalHandler
|
||||
*/
|
||||
virtual LexicalHandlerT* getLexicalHandler() const = 0;
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
// Parsing
|
||||
/**
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
#include <SAX/ext/DeclHandler.h>
|
||||
#include <SAX/ext/LexicalHandler.h>
|
||||
|
||||
#pragma message("DefaultHandler2 is deprecated. You can now use DefaultHandler instead.")
|
||||
|
||||
namespace SAX {
|
||||
|
||||
/**
|
||||
|
@ -36,9 +38,7 @@ namespace SAX {
|
|||
* @see basic_DeclHandler
|
||||
*/
|
||||
template<class string_type>
|
||||
class basic_DefaultHandler2 : public basic_DefaultHandler<string_type>,
|
||||
public basic_LexicalHandler<string_type>,
|
||||
public basic_DeclHandler<string_type>
|
||||
class basic_DefaultHandler2 : public basic_DefaultHandler<string_type>
|
||||
{
|
||||
public:
|
||||
typedef string_type stringT;
|
||||
|
@ -46,222 +46,6 @@ public:
|
|||
basic_DefaultHandler2() { }
|
||||
virtual ~basic_DefaultHandler2() { }
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
// LexicalHandler
|
||||
/**
|
||||
* Report the start of DTD declarations, if any.
|
||||
*
|
||||
* <p>This method is intended to report the beginning of the
|
||||
* DOCTYPE declaration; if the document has no DOCTYPE declaration,
|
||||
* this method will not be invoked.</p>
|
||||
*
|
||||
* <p>All declarations reported through
|
||||
* {@link basic_DTDHandler DTDHandler} or
|
||||
* {@link basic_DeclHandler DeclHandler} events must appear
|
||||
* between the startDTD and {@link #endDTD endDTD} events.
|
||||
* Declarations are assumed to belong to the internal DTD subset
|
||||
* unless they appear between {@link #startEntity startEntity}
|
||||
* and {@link #endEntity endEntity} events. Comments and
|
||||
* processing instructions from the DTD should also be reported
|
||||
* between the startDTD and endDTD events, in their original
|
||||
* order of (logical) occurrence; they are not required to
|
||||
* appear in their correct locations relative to DTDHandler
|
||||
* or DeclHandler events, however.</p>
|
||||
*
|
||||
* <p>Note that the start/endDTD events will appear within
|
||||
* the start/endDocument events from ContentHandler and
|
||||
* before the first
|
||||
* {@link basic_ContentHandler#startElement startElement}
|
||||
* event.</p>
|
||||
*
|
||||
* @param name The document type name.
|
||||
* @param publicId The declared public identifier for the
|
||||
* external DTD subset, or an empty string if none was declared.
|
||||
* @param systemId The declared system identifier for the
|
||||
* external DTD subset, or an empty string if none was declared.
|
||||
* @see #endDTD
|
||||
* @see #startEntity
|
||||
*/
|
||||
virtual void startDTD(const stringT& name,
|
||||
const stringT& publicId,
|
||||
const stringT& systemId) { }
|
||||
|
||||
/**
|
||||
* Report the end of DTD declarations.
|
||||
*
|
||||
* <p>This method is intended to report the end of the
|
||||
* DOCTYPE declaration; if the document has no DOCTYPE declaration,
|
||||
* this method will not be invoked.</p>
|
||||
*
|
||||
* @see #startDTD
|
||||
*/
|
||||
virtual void endDTD() { }
|
||||
|
||||
/**
|
||||
* Report the beginning of some internal and external XML entities.
|
||||
*
|
||||
* <p>The reporting of parameter entities (including
|
||||
* the external DTD subset) is optional, and SAX2 drivers that
|
||||
* support LexicalHandler may not support it; you can use the
|
||||
* <code
|
||||
* >http://xml.org/sax/features/lexical-handler/parameter-entities</code>
|
||||
* feature to query or control the reporting of parameter entities.</p>
|
||||
*
|
||||
* <p>General entities are reported with their regular names,
|
||||
* parameter entities have '%' prepended to their names, and
|
||||
* the external DTD subset has the pseudo-entity name "[dtd]".</p>
|
||||
*
|
||||
* <p>When a SAX2 driver is providing these events, all other
|
||||
* events must be properly nested within start/end entity
|
||||
* events. There is no additional requirement that events from
|
||||
* {@link basic_DeclHandler DeclHandler} or
|
||||
* {@link basic_DTDHandler DTDHandler} be properly ordered.</p>
|
||||
*
|
||||
* <p>Note that skipped entities will be reported through the
|
||||
* {@link basic_ContentHandler#skippedEntity skippedEntity}
|
||||
* event, which is part of the ContentHandler interface.</p>
|
||||
*
|
||||
* <p>Because of the streaming event model that SAX uses, some
|
||||
* entity boundaries cannot be reported under any
|
||||
* circumstances:</p>
|
||||
*
|
||||
* <ul>
|
||||
* <li>general entities within attribute values</li>
|
||||
* <li>parameter entities within declarations</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>These will be silently expanded, with no indication of where
|
||||
* the original entity boundaries were.</p>
|
||||
*
|
||||
* <p>Note also that the boundaries of character references (which
|
||||
* are not really entities anyway) are not reported.</p>
|
||||
*
|
||||
* <p>All start/endEntity events must be properly nested.
|
||||
*
|
||||
* @param name The name of the entity. If it is a parameter
|
||||
* entity, the name will begin with '%', and if it is the
|
||||
* external DTD subset, it will be "[dtd]".
|
||||
* @see #endEntity
|
||||
* @see basic_DeclHandler#internalEntityDecl
|
||||
* @see basic_DeclHandler#externalEntityDecl
|
||||
*/
|
||||
virtual void startEntity(const stringT& name) { }
|
||||
/**
|
||||
* Report the end of an entity.
|
||||
*
|
||||
* @param name The name of the entity that is ending.
|
||||
* @see #startEntity
|
||||
*/
|
||||
virtual void endEntity(const stringT& name) { }
|
||||
|
||||
/**
|
||||
* Report the start of a CDATA section.
|
||||
*
|
||||
* <p>The contents of the CDATA section will be reported through
|
||||
* the regular {@link basic_ContentHandler#characters
|
||||
* characters} event; this event is intended only to report
|
||||
* the boundary.</p>
|
||||
*
|
||||
* @see #endCDATA
|
||||
*/
|
||||
virtual void startCDATA() { }
|
||||
/**
|
||||
* Report the end of a CDATA section.
|
||||
*
|
||||
* @see #startCDATA
|
||||
*/
|
||||
virtual void endCDATA() { }
|
||||
|
||||
/**
|
||||
* Report an XML comment anywhere in the document.
|
||||
*
|
||||
* <p>This callback will be used for comments inside or outside the
|
||||
* document element, including comments in the external DTD
|
||||
* subset (if read). Comments in the DTD must be properly
|
||||
* nested inside start/endDTD and start/endEntity events (if
|
||||
* used).</p>
|
||||
*
|
||||
* @param text A string holding the comment.
|
||||
*/
|
||||
virtual void comment(const stringT& text) { }
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// DeclHandler
|
||||
/**
|
||||
* Report an element type declaration.
|
||||
*
|
||||
* <p>The content model will consist of the string "EMPTY", the
|
||||
* string "ANY", or a parenthesised group, optionally followed
|
||||
* by an occurrence indicator. The model will be normalized so
|
||||
* that all parameter entities are fully resolved and all whitespace
|
||||
* is removed,and will include the enclosing parentheses. Other
|
||||
* normalization (such as removing redundant parentheses or
|
||||
* simplifying occurrence indicators) is at the discretion of the
|
||||
* parser.</p>
|
||||
*
|
||||
* @param name The element type name.
|
||||
* @param model The content model as a normalized string.
|
||||
*/
|
||||
virtual void elementDecl(const stringT& name, const stringT& model) { }
|
||||
/**
|
||||
* Report an attribute type declaration.
|
||||
*
|
||||
* <p>Only the effective (first) declaration for an attribute will
|
||||
* be reported. The type will be one of the strings "CDATA",
|
||||
* "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY",
|
||||
* "ENTITIES", a parenthesized token group with
|
||||
* the separator "|" and all whitespace removed, or the word
|
||||
* "NOTATION" followed by a space followed by a parenthesized
|
||||
* token group with all whitespace removed.</p>
|
||||
*
|
||||
* <p>Any parameter entities in the attribute value will be
|
||||
* expanded, but general entities will not.</p>
|
||||
*
|
||||
* @param elementName The name of the associated element.
|
||||
* @param attributeName The name of the attribute.
|
||||
* @param type A string representing the attribute type.
|
||||
* @param valueDefault A string representing the attribute default
|
||||
* ("#IMPLIED", "#REQUIRED", or "#FIXED") or empty string if
|
||||
* none of these applies.
|
||||
* @param value A string representing the attribute's default value,
|
||||
* or empty string if there is none.
|
||||
*/
|
||||
virtual void attributeDecl(const stringT& elementName,
|
||||
const stringT& attributeName,
|
||||
const stringT& type,
|
||||
const stringT& valueDefault,
|
||||
const stringT& value) { }
|
||||
/**
|
||||
* Report an internal entity declaration.
|
||||
*
|
||||
* <p>Only the effective (first) declaration for each entity
|
||||
* will be reported. All parameter entities in the value
|
||||
* will be expanded, but general entities will not.</p>
|
||||
*
|
||||
* @param name The name of the entity. If it is a parameter
|
||||
* entity, the name will begin with '%'.
|
||||
* @param value The replacement text of the entity.
|
||||
* @see #externalEntityDecl
|
||||
* @see basic_DTDHandler#unparsedEntityDecl
|
||||
*/
|
||||
virtual void internalEntityDecl(const stringT& name, const stringT& value) { }
|
||||
/**
|
||||
* Report a parsed external entity declaration.
|
||||
*
|
||||
* <p>Only the effective (first) declaration for each entity
|
||||
* will be reported.</p>
|
||||
*
|
||||
* @param name The name of the entity. If it is a parameter
|
||||
* entity, the name will begin with '%'.
|
||||
* @param publicId The declared public identifier of the entity, or
|
||||
* an empty string if none was declared.
|
||||
* @param systemId The declared system identifier of the entity.
|
||||
* @see #internalEntityDecl
|
||||
* @see basic_DTDHandler#unparsedEntityDecl
|
||||
*/
|
||||
virtual void externalEntityDecl(const stringT& name,
|
||||
const stringT& publicId,
|
||||
const stringT& systemId) { }
|
||||
private:
|
||||
basic_DefaultHandler2(const basic_DefaultHandler2&);
|
||||
basic_DefaultHandler2& operator=(const basic_DefaultHandler2&);
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
#include <SAX/Locator.h>
|
||||
#include <SAX/Attributes.h>
|
||||
#include <SAX/SAXException.h>
|
||||
#include <SAX/ext/DeclHandler.h>
|
||||
#include <SAX/ext/LexicalHandler.h>
|
||||
|
||||
namespace SAX {
|
||||
|
||||
|
@ -51,7 +53,9 @@ template<class string_type>
|
|||
class basic_DefaultHandler : public basic_EntityResolver<string_type>,
|
||||
public basic_DTDHandler<string_type>,
|
||||
public basic_ContentHandler<string_type>,
|
||||
public basic_ErrorHandler<string_type>
|
||||
public basic_ErrorHandler<string_type>,
|
||||
public basic_LexicalHandler<string_type>,
|
||||
public basic_DeclHandler<string_type>
|
||||
{
|
||||
public:
|
||||
typedef string_type stringT;
|
||||
|
@ -367,6 +371,222 @@ public:
|
|||
// one of them, I presume, is wrong
|
||||
} // fatalError
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
// LexicalHandler
|
||||
/**
|
||||
* Report the start of DTD declarations, if any.
|
||||
*
|
||||
* <p>This method is intended to report the beginning of the
|
||||
* DOCTYPE declaration; if the document has no DOCTYPE declaration,
|
||||
* this method will not be invoked.</p>
|
||||
*
|
||||
* <p>All declarations reported through
|
||||
* {@link basic_DTDHandler DTDHandler} or
|
||||
* {@link basic_DeclHandler DeclHandler} events must appear
|
||||
* between the startDTD and {@link #endDTD endDTD} events.
|
||||
* Declarations are assumed to belong to the internal DTD subset
|
||||
* unless they appear between {@link #startEntity startEntity}
|
||||
* and {@link #endEntity endEntity} events. Comments and
|
||||
* processing instructions from the DTD should also be reported
|
||||
* between the startDTD and endDTD events, in their original
|
||||
* order of (logical) occurrence; they are not required to
|
||||
* appear in their correct locations relative to DTDHandler
|
||||
* or DeclHandler events, however.</p>
|
||||
*
|
||||
* <p>Note that the start/endDTD events will appear within
|
||||
* the start/endDocument events from ContentHandler and
|
||||
* before the first
|
||||
* {@link basic_ContentHandler#startElement startElement}
|
||||
* event.</p>
|
||||
*
|
||||
* @param name The document type name.
|
||||
* @param publicId The declared public identifier for the
|
||||
* external DTD subset, or an empty string if none was declared.
|
||||
* @param systemId The declared system identifier for the
|
||||
* external DTD subset, or an empty string if none was declared.
|
||||
* @see #endDTD
|
||||
* @see #startEntity
|
||||
*/
|
||||
virtual void startDTD(const stringT& name,
|
||||
const stringT& publicId,
|
||||
const stringT& systemId) { }
|
||||
|
||||
/**
|
||||
* Report the end of DTD declarations.
|
||||
*
|
||||
* <p>This method is intended to report the end of the
|
||||
* DOCTYPE declaration; if the document has no DOCTYPE declaration,
|
||||
* this method will not be invoked.</p>
|
||||
*
|
||||
* @see #startDTD
|
||||
*/
|
||||
virtual void endDTD() { }
|
||||
|
||||
/**
|
||||
* Report the beginning of some internal and external XML entities.
|
||||
*
|
||||
* <p>The reporting of parameter entities (including
|
||||
* the external DTD subset) is optional, and SAX2 drivers that
|
||||
* support LexicalHandler may not support it; you can use the
|
||||
* <code
|
||||
* >http://xml.org/sax/features/lexical-handler/parameter-entities</code>
|
||||
* feature to query or control the reporting of parameter entities.</p>
|
||||
*
|
||||
* <p>General entities are reported with their regular names,
|
||||
* parameter entities have '%' prepended to their names, and
|
||||
* the external DTD subset has the pseudo-entity name "[dtd]".</p>
|
||||
*
|
||||
* <p>When a SAX2 driver is providing these events, all other
|
||||
* events must be properly nested within start/end entity
|
||||
* events. There is no additional requirement that events from
|
||||
* {@link basic_DeclHandler DeclHandler} or
|
||||
* {@link basic_DTDHandler DTDHandler} be properly ordered.</p>
|
||||
*
|
||||
* <p>Note that skipped entities will be reported through the
|
||||
* {@link basic_ContentHandler#skippedEntity skippedEntity}
|
||||
* event, which is part of the ContentHandler interface.</p>
|
||||
*
|
||||
* <p>Because of the streaming event model that SAX uses, some
|
||||
* entity boundaries cannot be reported under any
|
||||
* circumstances:</p>
|
||||
*
|
||||
* <ul>
|
||||
* <li>general entities within attribute values</li>
|
||||
* <li>parameter entities within declarations</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>These will be silently expanded, with no indication of where
|
||||
* the original entity boundaries were.</p>
|
||||
*
|
||||
* <p>Note also that the boundaries of character references (which
|
||||
* are not really entities anyway) are not reported.</p>
|
||||
*
|
||||
* <p>All start/endEntity events must be properly nested.
|
||||
*
|
||||
* @param name The name of the entity. If it is a parameter
|
||||
* entity, the name will begin with '%', and if it is the
|
||||
* external DTD subset, it will be "[dtd]".
|
||||
* @see #endEntity
|
||||
* @see basic_DeclHandler#internalEntityDecl
|
||||
* @see basic_DeclHandler#externalEntityDecl
|
||||
*/
|
||||
virtual void startEntity(const stringT& name) { }
|
||||
/**
|
||||
* Report the end of an entity.
|
||||
*
|
||||
* @param name The name of the entity that is ending.
|
||||
* @see #startEntity
|
||||
*/
|
||||
virtual void endEntity(const stringT& name) { }
|
||||
|
||||
/**
|
||||
* Report the start of a CDATA section.
|
||||
*
|
||||
* <p>The contents of the CDATA section will be reported through
|
||||
* the regular {@link basic_ContentHandler#characters
|
||||
* characters} event; this event is intended only to report
|
||||
* the boundary.</p>
|
||||
*
|
||||
* @see #endCDATA
|
||||
*/
|
||||
virtual void startCDATA() { }
|
||||
/**
|
||||
* Report the end of a CDATA section.
|
||||
*
|
||||
* @see #startCDATA
|
||||
*/
|
||||
virtual void endCDATA() { }
|
||||
|
||||
/**
|
||||
* Report an XML comment anywhere in the document.
|
||||
*
|
||||
* <p>This callback will be used for comments inside or outside the
|
||||
* document element, including comments in the external DTD
|
||||
* subset (if read). Comments in the DTD must be properly
|
||||
* nested inside start/endDTD and start/endEntity events (if
|
||||
* used).</p>
|
||||
*
|
||||
* @param text A string holding the comment.
|
||||
*/
|
||||
virtual void comment(const stringT& text) { }
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// DeclHandler
|
||||
/**
|
||||
* Report an element type declaration.
|
||||
*
|
||||
* <p>The content model will consist of the string "EMPTY", the
|
||||
* string "ANY", or a parenthesised group, optionally followed
|
||||
* by an occurrence indicator. The model will be normalized so
|
||||
* that all parameter entities are fully resolved and all whitespace
|
||||
* is removed,and will include the enclosing parentheses. Other
|
||||
* normalization (such as removing redundant parentheses or
|
||||
* simplifying occurrence indicators) is at the discretion of the
|
||||
* parser.</p>
|
||||
*
|
||||
* @param name The element type name.
|
||||
* @param model The content model as a normalized string.
|
||||
*/
|
||||
virtual void elementDecl(const stringT& name, const stringT& model) { }
|
||||
/**
|
||||
* Report an attribute type declaration.
|
||||
*
|
||||
* <p>Only the effective (first) declaration for an attribute will
|
||||
* be reported. The type will be one of the strings "CDATA",
|
||||
* "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY",
|
||||
* "ENTITIES", a parenthesized token group with
|
||||
* the separator "|" and all whitespace removed, or the word
|
||||
* "NOTATION" followed by a space followed by a parenthesized
|
||||
* token group with all whitespace removed.</p>
|
||||
*
|
||||
* <p>Any parameter entities in the attribute value will be
|
||||
* expanded, but general entities will not.</p>
|
||||
*
|
||||
* @param elementName The name of the associated element.
|
||||
* @param attributeName The name of the attribute.
|
||||
* @param type A string representing the attribute type.
|
||||
* @param valueDefault A string representing the attribute default
|
||||
* ("#IMPLIED", "#REQUIRED", or "#FIXED") or empty string if
|
||||
* none of these applies.
|
||||
* @param value A string representing the attribute's default value,
|
||||
* or empty string if there is none.
|
||||
*/
|
||||
virtual void attributeDecl(const stringT& elementName,
|
||||
const stringT& attributeName,
|
||||
const stringT& type,
|
||||
const stringT& valueDefault,
|
||||
const stringT& value) { }
|
||||
/**
|
||||
* Report an internal entity declaration.
|
||||
*
|
||||
* <p>Only the effective (first) declaration for each entity
|
||||
* will be reported. All parameter entities in the value
|
||||
* will be expanded, but general entities will not.</p>
|
||||
*
|
||||
* @param name The name of the entity. If it is a parameter
|
||||
* entity, the name will begin with '%'.
|
||||
* @param value The replacement text of the entity.
|
||||
* @see #externalEntityDecl
|
||||
* @see basic_DTDHandler#unparsedEntityDecl
|
||||
*/
|
||||
virtual void internalEntityDecl(const stringT& name, const stringT& value) { }
|
||||
/**
|
||||
* Report a parsed external entity declaration.
|
||||
*
|
||||
* <p>Only the effective (first) declaration for each entity
|
||||
* will be reported.</p>
|
||||
*
|
||||
* @param name The name of the entity. If it is a parameter
|
||||
* entity, the name will begin with '%'.
|
||||
* @param publicId The declared public identifier of the entity, or
|
||||
* an empty string if none was declared.
|
||||
* @param systemId The declared system identifier of the entity.
|
||||
* @see #internalEntityDecl
|
||||
* @see basic_DTDHandler#unparsedEntityDecl
|
||||
*/
|
||||
virtual void externalEntityDecl(const stringT& name,
|
||||
const stringT& publicId,
|
||||
const stringT& systemId) { }
|
||||
private:
|
||||
basic_DefaultHandler(const basic_DefaultHandler&);
|
||||
basic_DefaultHandler& operator=(const basic_DefaultHandler&);
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
#ifndef ARABICA_XML_FILTER_IMPL_H
|
||||
#define ARABICA_XML_FILTER_IMPL_H
|
||||
|
||||
// XMLFilter.h
|
||||
// $Id$
|
||||
// XMLFilterImpl.h
|
||||
|
||||
#include <SAX/ArabicaConfig.h>
|
||||
#include <string>
|
||||
|
@ -37,10 +36,12 @@ namespace SAX
|
|||
*/
|
||||
template<class string_type, class string_adaptor_type = Arabica::default_string_adaptor<string_type> >
|
||||
class basic_XMLFilterImpl : public basic_XMLFilter<string_type>,
|
||||
public basic_EntityResolver<string_type>,
|
||||
public basic_DTDHandler<string_type>,
|
||||
public basic_ContentHandler<string_type>,
|
||||
public basic_ErrorHandler<string_type>
|
||||
public basic_EntityResolver<string_type>,
|
||||
public basic_DTDHandler<string_type>,
|
||||
public basic_ContentHandler<string_type>,
|
||||
public basic_ErrorHandler<string_type>,
|
||||
public basic_DeclHandler<string_type>,
|
||||
public basic_LexicalHandler<string_type>
|
||||
{
|
||||
public:
|
||||
typedef string_type stringT;
|
||||
|
@ -52,6 +53,8 @@ public:
|
|||
typedef basic_InputSource<stringT> InputSourceT;
|
||||
typedef basic_Locator<stringT> LocatorT;
|
||||
typedef basic_ErrorHandler<stringT> ErrorHandlerT;
|
||||
typedef basic_DeclHandler<stringT> DeclHandlerT;
|
||||
typedef basic_LexicalHandler<stringT> LexicalHandlerT;
|
||||
typedef typename basic_ErrorHandler<stringT>::SAXParseExceptionT SAXParseExceptionT;
|
||||
|
||||
|
||||
|
@ -202,6 +205,11 @@ public:
|
|||
*/
|
||||
virtual ErrorHandlerT* getErrorHandler() const { return errorHandler_; }
|
||||
|
||||
virtual void setDeclHandler(DeclHandlerT& handler) { declHandler_ = &handler; }
|
||||
virtual DeclHandlerT* getDeclHandler() const { return declHandler_; }
|
||||
virtual void setLexicalHandler(LexicalHandlerT& handler) { lexicalHandler_ = &handler; }
|
||||
virtual LexicalHandlerT* getLexicalHandler() const { return lexicalHandler_; }
|
||||
|
||||
/**
|
||||
* Parse a document.
|
||||
*
|
||||
|
@ -270,8 +278,7 @@ public:
|
|||
const stringT& publicId,
|
||||
const stringT& systemId)
|
||||
{
|
||||
if(dtdHandler_)
|
||||
dtdHandler_->notationDecl(name, publicId, systemId);
|
||||
dtdHandler_->notationDecl(name, publicId, systemId);
|
||||
} // notationDecl
|
||||
|
||||
/**
|
||||
|
@ -288,8 +295,7 @@ public:
|
|||
const stringT& systemId,
|
||||
const stringT& notationName)
|
||||
{
|
||||
if(dtdHandler_)
|
||||
dtdHandler_->unparsedEntityDecl(name, publicId, systemId, notationName);
|
||||
dtdHandler_->unparsedEntityDecl(name, publicId, systemId, notationName);
|
||||
} // unparsedEntityDecl
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
|
@ -303,8 +309,7 @@ public:
|
|||
virtual void setDocumentLocator(const LocatorT& locator)
|
||||
{
|
||||
locator_ = &locator;
|
||||
if(contentHandler_)
|
||||
contentHandler_->setDocumentLocator(locator);
|
||||
contentHandler_->setDocumentLocator(locator);
|
||||
} // setDocumentLocator
|
||||
|
||||
/**
|
||||
|
@ -314,8 +319,7 @@ public:
|
|||
*/
|
||||
virtual void startDocument()
|
||||
{
|
||||
if(contentHandler_)
|
||||
contentHandler_->startDocument();
|
||||
contentHandler_->startDocument();
|
||||
} // startDocument
|
||||
|
||||
/**
|
||||
|
@ -325,8 +329,7 @@ public:
|
|||
*/
|
||||
virtual void endDocument()
|
||||
{
|
||||
if(contentHandler_)
|
||||
contentHandler_->endDocument();
|
||||
contentHandler_->endDocument();
|
||||
} // endDocument
|
||||
|
||||
/**
|
||||
|
@ -338,8 +341,7 @@ public:
|
|||
*/
|
||||
virtual void startPrefixMapping(const stringT& prefix, const stringT& uri)
|
||||
{
|
||||
if(contentHandler_)
|
||||
contentHandler_->startPrefixMapping(prefix, uri);
|
||||
contentHandler_->startPrefixMapping(prefix, uri);
|
||||
} // startPrefixMapping
|
||||
|
||||
/**
|
||||
|
@ -350,8 +352,7 @@ public:
|
|||
*/
|
||||
virtual void endPrefixMapping(const stringT& prefix)
|
||||
{
|
||||
if(contentHandler_)
|
||||
contentHandler_->endPrefixMapping(prefix);
|
||||
contentHandler_->endPrefixMapping(prefix);
|
||||
} // endPrefixMapping
|
||||
|
||||
/**
|
||||
|
@ -367,8 +368,7 @@ public:
|
|||
virtual void startElement(const stringT& namespaceURI, const stringT& localName,
|
||||
const stringT& qName, const typename ContentHandlerT::AttributesT& atts)
|
||||
{
|
||||
if(contentHandler_)
|
||||
contentHandler_->startElement(namespaceURI, localName, qName, atts);
|
||||
contentHandler_->startElement(namespaceURI, localName, qName, atts);
|
||||
} // startElement
|
||||
|
||||
/**
|
||||
|
@ -383,8 +383,7 @@ public:
|
|||
virtual void endElement(const stringT& namespaceURI, const stringT& localName,
|
||||
const stringT& qName)
|
||||
{
|
||||
if(contentHandler_)
|
||||
contentHandler_->endElement(namespaceURI, localName, qName);
|
||||
contentHandler_->endElement(namespaceURI, localName, qName);
|
||||
} // endElement
|
||||
|
||||
/**
|
||||
|
@ -395,8 +394,7 @@ public:
|
|||
*/
|
||||
virtual void characters(const stringT& ch)
|
||||
{
|
||||
if(contentHandler_)
|
||||
contentHandler_->characters(ch);
|
||||
contentHandler_->characters(ch);
|
||||
} // characters
|
||||
|
||||
/**
|
||||
|
@ -407,8 +405,7 @@ public:
|
|||
*/
|
||||
virtual void ignorableWhitespace(const stringT& ch)
|
||||
{
|
||||
if(contentHandler_)
|
||||
contentHandler_->ignorableWhitespace(ch);
|
||||
contentHandler_->ignorableWhitespace(ch);
|
||||
} // ignorableWhitespace
|
||||
|
||||
/**
|
||||
|
@ -420,8 +417,7 @@ public:
|
|||
*/
|
||||
virtual void processingInstruction(const stringT& target, const stringT& data)
|
||||
{
|
||||
if(contentHandler_)
|
||||
contentHandler_->processingInstruction(target, data);
|
||||
contentHandler_->processingInstruction(target, data);
|
||||
} // processingInstruction
|
||||
|
||||
/**
|
||||
|
@ -432,8 +428,7 @@ public:
|
|||
*/
|
||||
virtual void skippedEntity(const stringT& name)
|
||||
{
|
||||
if(contentHandler_)
|
||||
contentHandler_->skippedEntity(name);
|
||||
contentHandler_->skippedEntity(name);
|
||||
} // skippedEntity
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
|
@ -446,8 +441,7 @@ public:
|
|||
*/
|
||||
virtual void warning(const SAXParseExceptionT& exception)
|
||||
{
|
||||
if(errorHandler_)
|
||||
errorHandler_->warning(exception);
|
||||
errorHandler_->warning(exception);
|
||||
} // warning
|
||||
|
||||
/**
|
||||
|
@ -458,8 +452,7 @@ public:
|
|||
*/
|
||||
virtual void error(const SAXParseExceptionT& exception)
|
||||
{
|
||||
if(errorHandler_)
|
||||
errorHandler_->error(exception);
|
||||
errorHandler_->error(exception);
|
||||
} // error
|
||||
|
||||
/**
|
||||
|
@ -470,10 +463,108 @@ public:
|
|||
*/
|
||||
virtual void fatalError(const SAXParseExceptionT& exception)
|
||||
{
|
||||
if(errorHandler_)
|
||||
errorHandler_->fatalError(exception);
|
||||
errorHandler_->fatalError(exception);
|
||||
} // fatalError
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// DeclHandler
|
||||
/**
|
||||
* Filter an element type declaration.
|
||||
*/
|
||||
virtual void elementDecl(const stringT& name, const stringT& model)
|
||||
{
|
||||
declHandler_->elementDecl(name, model);
|
||||
} // elementDecl
|
||||
|
||||
/**
|
||||
* Filter an attribute type declaration.
|
||||
*/
|
||||
virtual void attributeDecl(const stringT& elementName,
|
||||
const stringT& attributeName,
|
||||
const stringT& type,
|
||||
const stringT& valueDefault,
|
||||
const stringT& value)
|
||||
{
|
||||
declHandler_->attributeDecl(elementName, attributeName, type, valueDefault, value);
|
||||
} // attributeDecl
|
||||
|
||||
/**
|
||||
* Filter an internal entity declaration.
|
||||
*/
|
||||
virtual void internalEntityDecl(const stringT& name, const stringT& value)
|
||||
{
|
||||
declHandler_->internalEntityDecl(name, value);
|
||||
} // internalEntityDecl
|
||||
|
||||
/**
|
||||
* Filter a parsed external entity declaration.
|
||||
*/
|
||||
virtual void externalEntityDecl(const stringT& name,
|
||||
const stringT& publicId,
|
||||
const stringT& systemId)
|
||||
{
|
||||
declHandler_->externalEntityDecl(name, publicId, systemId);
|
||||
} // externalEntityDecl
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
// LexicalHandler
|
||||
/**
|
||||
* Filter the start of DTD declarations, if any.
|
||||
*/
|
||||
virtual void startDTD(const stringT& name,
|
||||
const stringT& publicId,
|
||||
const stringT& systemId)
|
||||
{
|
||||
lexicalHandler_->startDTD(name, publicId, systemId);
|
||||
} // startDTD
|
||||
|
||||
/**
|
||||
* Filter the end of DTD declarations.
|
||||
*/
|
||||
virtual void endDTD()
|
||||
{
|
||||
lexicalHandler_->endDTD();
|
||||
} // endDTD
|
||||
|
||||
/**
|
||||
* Filter the beginning of some internal and external XML entities.
|
||||
*/
|
||||
virtual void startEntity(const stringT& name)
|
||||
{
|
||||
lexicalHandler_->startEntity(name);
|
||||
} // startEntity
|
||||
|
||||
/**
|
||||
* Filter the end of an entity.
|
||||
*/
|
||||
virtual void endEntity(const stringT& name)
|
||||
{
|
||||
lexicalHandler_->endEntity(name);
|
||||
} // endEntity
|
||||
|
||||
/**
|
||||
* Filter the start of a CDATA section.
|
||||
*/
|
||||
virtual void startCDATA()
|
||||
{
|
||||
lexicalHandler_->startCDATA();
|
||||
} // startCDATA
|
||||
|
||||
/**
|
||||
* Filter the end of a CDATA section.
|
||||
*/
|
||||
virtual void endCDATA()
|
||||
{
|
||||
lexicalHandler_->endCDATA();
|
||||
} // endCDATA
|
||||
|
||||
/**
|
||||
* Filter an XML comment anywhere in the document.
|
||||
*/
|
||||
virtual void comment(const stringT& text)
|
||||
{
|
||||
lexicalHandler_->comment(text);
|
||||
} // comment
|
||||
|
||||
private:
|
||||
void setDefaults()
|
||||
|
@ -482,6 +573,8 @@ private:
|
|||
setDTDHandler(defaultHandler_);
|
||||
setContentHandler(defaultHandler_);
|
||||
setErrorHandler(defaultHandler_);
|
||||
setDeclHandler(defaultHandler_);
|
||||
setLexicalHandler(defaultHandler_);
|
||||
} // setDefaults
|
||||
|
||||
void setupParse()
|
||||
|
@ -490,6 +583,8 @@ private:
|
|||
parent_->setDTDHandler(*this);
|
||||
parent_->setContentHandler(*this);
|
||||
parent_->setErrorHandler(*this);
|
||||
parent_->setDeclHandler(*this);
|
||||
parent_->setLexicalHandler(*this);
|
||||
} // setupParse
|
||||
|
||||
basic_XMLFilterImpl(const basic_XMLFilterImpl&);
|
||||
|
@ -501,6 +596,8 @@ private:
|
|||
DTDHandlerT* dtdHandler_;
|
||||
ContentHandlerT* contentHandler_;
|
||||
ErrorHandlerT* errorHandler_;
|
||||
DeclHandlerT* declHandler_;
|
||||
LexicalHandlerT* lexicalHandler_;
|
||||
const LocatorT* locator_;
|
||||
basic_DefaultHandler<stringT> defaultHandler_;
|
||||
}; // class basic_XMLFilter
|
||||
|
|
|
@ -14,8 +14,6 @@
|
|||
#include <SAX/SAXParseException.h>
|
||||
#include <SAX/SAXNotRecognizedException.h>
|
||||
#include <SAX/SAXNotSupportedException.h>
|
||||
#include <SAX/ext/DeclHandler.h>
|
||||
#include <SAX/ext/LexicalHandler.h>
|
||||
#include <SAX/helpers/DefaultHandler.h>
|
||||
#include <SAX/helpers/AttributesImpl.h>
|
||||
#include <SAX/helpers/NamespaceSupport.h>
|
||||
|
@ -247,6 +245,10 @@ class expat_wrapper : public SAX::basic_XMLReader<string_type>,
|
|||
virtual contentHandlerT* getContentHandler() const { return contentHandler_; }
|
||||
virtual void setErrorHandler(errorHandlerT& handler) { errorHandler_ = &handler; }
|
||||
virtual errorHandlerT* getErrorHandler() const { return errorHandler_; }
|
||||
virtual void setDeclHandler(declHandlerT& handler) { declHandler_ = &handler; }
|
||||
virtual declHandlerT* getDeclHandler() const { return declHandler_; }
|
||||
virtual void setLexicalHandler(lexicalHandlerT& handler) { lexicalHandler_ = &handler; }
|
||||
virtual lexicalHandlerT* getLexicalHandler() const { return lexicalHandler_; }
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
// Parsing
|
||||
|
@ -716,7 +718,7 @@ void expat_wrapper<stringT, T0, T1>::endElement(const char* qName)
|
|||
typename namespaceSupportT::Parts name = processName(SA::construct_from_utf8(qName), false);
|
||||
contentHandler_->endElement(name.URI, name.localName, name.rawName);
|
||||
typename namespaceSupportT::stringListT prefixes = nsSupport_.getDeclaredPrefixes();
|
||||
for(size_t i = 1, end = prefixes.size(); i < end; ++i)
|
||||
for(size_t i = 0, end = prefixes.size(); i < end; ++i)
|
||||
contentHandler_->endPrefixMapping(prefixes[i]);
|
||||
nsSupport_.popContext();
|
||||
} // endElement
|
||||
|
|
|
@ -18,8 +18,6 @@
|
|||
#include <cstdarg>
|
||||
#include <typeinfo>
|
||||
|
||||
#include <SAX/ext/LexicalHandler.h>
|
||||
#include <SAX/ext/DeclHandler.h>
|
||||
#include <SAX/helpers/FeatureNames.h>
|
||||
#include <SAX/helpers/PropertyNames.h>
|
||||
#include <SAX/helpers/NamespaceSupport.h>
|
||||
|
@ -55,6 +53,7 @@ class libxml2_base
|
|||
virtual void SAXerror(const std::string& error) = 0;
|
||||
virtual void SAXfatalError(const std::string& fatal) = 0;
|
||||
virtual void SAXprocessingInstruction(const xmlChar* target, const xmlChar* data) = 0;
|
||||
virtual void SAXcomment(const xmlChar* comment) = 0;
|
||||
virtual void SAXstartElement(const xmlChar* name, const xmlChar** attrs) = 0;
|
||||
virtual void SAXendElement(const xmlChar* name) = 0;
|
||||
virtual void SAXnotationDecl(const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId) = 0;
|
||||
|
@ -73,6 +72,7 @@ class libxml2_base
|
|||
friend void lwit_error(void* user_data, const char* fmt, ...);
|
||||
friend void lwit_fatalError(void* user_data, const char* fmt, ...);
|
||||
friend void lwit_processingInstruction(void *user_data, const xmlChar* target, const xmlChar* data);
|
||||
friend void lwit_comment(void *user_data, const xmlChar* comment);
|
||||
friend void lwit_startElement(void *user_data, const xmlChar* name, const xmlChar** attrs);
|
||||
friend void lwit_endElement(void* user_data, const xmlChar* name);
|
||||
friend void lwit_notationDecl(void* user_data, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId);
|
||||
|
@ -90,6 +90,7 @@ void lwit_endElement(void *user_data, const xmlChar* name);
|
|||
void lwit_characters(void* user_data, const xmlChar* ch, int len);
|
||||
void lwit_ignorableWhitespace(void *user_data, const xmlChar* ch, int len);
|
||||
void lwit_processingInstruction(void *user_data, const xmlChar* target, const xmlChar* data);
|
||||
void lwit_comment(void *user_data, const xmlChar* comment);
|
||||
void lwit_warning(void *user_data, const char* fmt, ...);
|
||||
void lwit_error(void* user_data, const char* fmt, ...);
|
||||
void lwit_fatalError(void* user_data, const char* fmt, ...);
|
||||
|
@ -157,6 +158,10 @@ class libxml2_wrapper : public basic_XMLReader<string_type>,
|
|||
virtual basic_ContentHandler<stringT>* getContentHandler() const { return contentHandler_; }
|
||||
virtual void setErrorHandler(errorHandlerT& handler) { errorHandler_ = &handler; }
|
||||
virtual errorHandlerT* getErrorHandler() const { return errorHandler_; }
|
||||
virtual void setDeclHandler(declHandlerT& handler) { declHandler_ = &handler; }
|
||||
virtual declHandlerT* getDeclHandler() const { return declHandler_; }
|
||||
virtual void setLexicalHandler(lexicalHandlerT& handler) { lexicalHandler_ = &handler; }
|
||||
virtual lexicalHandlerT* getLexicalHandler() const { return lexicalHandler_; }
|
||||
|
||||
////////////////////////////////////////////////
|
||||
// parsing
|
||||
|
@ -184,6 +189,7 @@ class libxml2_wrapper : public basic_XMLReader<string_type>,
|
|||
virtual void SAXerror(const std::string& error);
|
||||
virtual void SAXfatalError(const std::string& fatal);
|
||||
virtual void SAXprocessingInstruction(const xmlChar* target, const xmlChar* data);
|
||||
virtual void SAXcomment(const xmlChar* comment);
|
||||
virtual void SAXstartElement(const xmlChar* name, const xmlChar** attrs);
|
||||
virtual void SAXstartElementNoNS(const xmlChar* name, const xmlChar** attrs);
|
||||
virtual void SAXendElement(const xmlChar* name);
|
||||
|
@ -209,6 +215,7 @@ class libxml2_wrapper : public basic_XMLReader<string_type>,
|
|||
errorHandlerT* errorHandler_;
|
||||
namespaceSupportT nsSupport_;
|
||||
declHandlerT* declHandler_;
|
||||
lexicalHandlerT* lexicalHandler_;
|
||||
|
||||
xmlParserCtxtPtr context_;
|
||||
xmlSAXLocatorPtr locator_;
|
||||
|
@ -337,7 +344,10 @@ std::auto_ptr<libxml2_wrapper<stringT, T0, T1>::PropertyBaseT> libxml2_wrapper<s
|
|||
return std::auto_ptr<PropertyBaseT>(prop);
|
||||
}
|
||||
if(name == properties_.lexicalHandler)
|
||||
throw SAX::SAXNotSupportedException(std::string("Property not supported ") + string_adaptorT::asStdString(name));
|
||||
{
|
||||
getLexicalHandlerT* prop = new getLexicalHandlerT(lexicalHandler_);
|
||||
return std::auto_ptr<PropertyBaseT>(prop);
|
||||
}
|
||||
|
||||
throw SAX::SAXNotRecognizedException(std::string("Property not recognized ") + string_adaptorT::asStdString(name));
|
||||
} // doGetProperty
|
||||
|
@ -355,7 +365,14 @@ void libxml2_wrapper<stringT, T0, T1>::doSetProperty(const stringT& name, std::a
|
|||
declHandler_ = &(prop->get());
|
||||
}
|
||||
if(name == properties_.lexicalHandler)
|
||||
throw SAX::SAXNotSupportedException(std::string("Property not supported ") + string_adaptorT::asStdString(name));
|
||||
{
|
||||
setLexicalHandlerT* prop = dynamic_cast<setLexicalHandlerT*>(value.get());
|
||||
|
||||
if(!prop)
|
||||
throw std::bad_cast();
|
||||
|
||||
lexicalHandler_ = &(prop->get());
|
||||
}
|
||||
|
||||
throw SAX::SAXNotRecognizedException(std::string("Property not recognized ") + string_adaptorT::asStdString(name));
|
||||
} // doSetProperty
|
||||
|
@ -505,6 +522,13 @@ void libxml2_wrapper<stringT, T0, T1>::SAXprocessingInstruction(const xmlChar* t
|
|||
string_adaptorT::construct_from_utf8(reinterpret_cast<const char*>(data)));
|
||||
} // SAXprocessingInstruction
|
||||
|
||||
template<class stringT, class T0, class T1>
|
||||
void libxml2_wrapper<stringT, T0, T1>::SAXcomment(const xmlChar* comment)
|
||||
{
|
||||
if(lexicalHandler_)
|
||||
lexicalHandler_->comment(string_adaptorT::construct_from_utf8(reinterpret_cast<const char*>(comment)));
|
||||
} // SAXcomment
|
||||
|
||||
template<class stringT, class T0, class T1>
|
||||
void libxml2_wrapper<stringT, T0, T1>::SAXstartElement(const xmlChar* qName, const xmlChar** atts)
|
||||
{
|
||||
|
@ -602,7 +626,7 @@ void libxml2_wrapper<stringT, T0, T1>::SAXendElement(const xmlChar* qName)
|
|||
typename basic_NamespaceSupport<stringT, string_adaptorT>::Parts name = processName(string_adaptorT::construct_from_utf8(reinterpret_cast<const char*>(qName)), false);
|
||||
contentHandler_->endElement(name.URI, name.localName, name.rawName);
|
||||
typename basic_NamespaceSupport<stringT, string_adaptorT>::stringListT prefixes = nsSupport_.getDeclaredPrefixes();
|
||||
for(size_t i = 1, end = prefixes.size(); i < end; ++i)
|
||||
for(size_t i = 0, end = prefixes.size(); i < end; ++i)
|
||||
contentHandler_->endPrefixMapping(prefixes[i]);
|
||||
nsSupport_.popContext();
|
||||
} // SAXendElement
|
||||
|
|
|
@ -2,24 +2,6 @@
|
|||
#define ARABICA_SAX_MSXML2_H
|
||||
//---------------------------------------------------------------------------
|
||||
// A SAX2 wrapper class for MSXML component.
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// Changes:
|
||||
// 21-Jul-2002 Major tweaks to use #include <header> rather then
|
||||
// #import <type_library>. The latter is sensitive to
|
||||
// the exact name/version of the library provided by
|
||||
// Microsoft and various options provided to the type
|
||||
// library reader. (Found the issue when I attempted
|
||||
// to build with MSXML4 rather then MSXML3.) [kas]
|
||||
//
|
||||
// 31-Jul-2002 Created the default PROGID define. M$. in their
|
||||
// wisdom, removed the version independent IDs starting
|
||||
// in version 4.0 of the MSXML library. Saves a lot of
|
||||
// 'DLL hell' problems but creates others for maintainers.
|
||||
// The initialization code will now try the 4.0 ID and
|
||||
// then the older (version independant) name. [kas]
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#include <SAX/ArabicaConfig.h>
|
||||
|
@ -28,8 +10,6 @@
|
|||
#include <SAX/SAXParseException.h>
|
||||
#include <SAX/SAXNotRecognizedException.h>
|
||||
#include <SAX/SAXNotSupportedException.h>
|
||||
#include <SAX/ext/LexicalHandler.h>
|
||||
#include <SAX/ext/DeclHandler.h>
|
||||
#include <SAX/helpers/PropertyNames.h>
|
||||
#include <Utils/StringAdaptor.h>
|
||||
#include <iostream>
|
||||
|
@ -118,6 +98,10 @@ class msxml2_wrapper : public SAX::basic_XMLReader<string_type>
|
|||
virtual SAX::basic_ContentHandler<string_type>* getContentHandler() const { return contentHandler_.getContentHandler(); }
|
||||
virtual void setErrorHandler(SAX::basic_ErrorHandler<string_type>& handler);
|
||||
virtual SAX::basic_ErrorHandler<string_type>* getErrorHandler() const;
|
||||
virtual void setDeclHandler(declHandlerT& handler) { declHandler_.setDeclHandler(handler); }
|
||||
virtual declHandlerT* getDeclHandler() const { return declHandler_.getDeclHandler(); }
|
||||
virtual void setLexicalHandler(lexicalHandlerT& handler) { lexicalHandler_.setLexicalHandler(handler); }
|
||||
virtual lexicalHandlerT* getLexicalHandler() const { return lexicalHandler_.getLexicalHandler(); }
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
// Parsing
|
||||
|
|
|
@ -163,6 +163,10 @@ class xerces_wrapper : public SAX::basic_ProgressiveParser<string_type>
|
|||
virtual ContentHandlerT* getContentHandler() const { return contentHandlerAdaptor_.getContentHandler(); }
|
||||
virtual void setErrorHandler(ErrorHandlerT& handler) { errorHandlerAdaptor_.setErrorHandler(handler); }
|
||||
virtual ErrorHandlerT* getErrorHandler() const { return errorHandlerAdaptor_.getErrorHandler(); }
|
||||
virtual void setDeclHandler(DeclHandlerT& handler) { declHandlerAdaptor_.setDeclHandler(handler); }
|
||||
virtual DeclHandlerT* getDeclHandler() const { return declHandlerAdaptor_.getDeclHandler(); }
|
||||
virtual void setLexicalHandler(LexicalHandlerT& handler) { lexicalHandlerAdaptor_.setLexicalHandler(handler); }
|
||||
virtual LexicalHandlerT* getLexicalHandler() const { return lexicalHandlerAdaptor_.getLexicalHandler(); }
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
// Parsing
|
||||
|
|
Loading…
Add table
Reference in a new issue