Logo Search packages:      
Sourcecode: poco version File versions  Download package

Poco::XML::ParserEngine Class Reference

#include <ParserEngine.h>

Inheritance diagram for Poco::XML::ParserEngine:

Poco::XML::Locator

List of all members.


Detailed Description

This class provides an object-oriented, stream-based, low-level interface to the XML Parser Toolkit (expat). It is strongly recommended, that you use the SAX parser classes (which are based on this class) instead of this class, since they provide a standardized, higher-level interface to the parser.

Definition at line 67 of file ParserEngine.h.


Public Member Functions

void addEncoding (const XMLString &name, Poco::TextEncoding *pEncoding)
 Returns the encoding used by expat.
int getColumnNumber () const
 Return the line number where the current document event ends.
ContentHandlergetContentHandler () const
 Allow an application to register a content event handler.
DeclHandlergetDeclHandler () const
 Allow an application to register a DTD declarations event handler.
DTDHandlergetDTDHandler () const
 Allow an application to register a DTD event handler.
const XMLString & getEncoding () const
EntityResolvergetEntityResolver () const
 Allow an application to register an entity resolver.
ErrorHandlergetErrorHandler () const
 Allow an application to register an error event handler.
bool getExpandInternalEntities () const
bool getExternalGeneralEntities () const
 Enable or disable processing of external general entities.
bool getExternalParameterEntities () const
 Enable or disable processing of external parameter entities.
LexicalHandlergetLexicalHandler () const
 Allow an application to register a lexical event handler.
int getLineNumber () const
 Return the system identifier for the current document event.
NamespaceStrategygetNamespaceStrategy () const
XMLString getPublicId () const
 Parse an XML document from the given InputSource.
XMLString getSystemId () const
 Return the public identifier for the current document event.
void parse (InputSource *pInputSource)
 Return the current error handler.
 ParserEngine (const XMLString &encoding)
 Creates the parser engine.
void setContentHandler (ContentHandler *pContentHandler)
 Return the current DTD declarations handler.
void setDeclHandler (DeclHandler *pDeclHandler)
 Return the current DTD handler.
void setDTDHandler (DTDHandler *pDTDHandler)
 Return the current entity resolver.
void setEncoding (const XMLString &encoding)
 Destroys the parser.
void setEntityResolver (EntityResolver *pResolver)
 Returns true if external parameter entities will be processed; false otherwise.
void setErrorHandler (ErrorHandler *pErrorHandler)
 Return the current lexical handler.
void setExpandInternalEntities (bool flag=true)
 Returns the NamespaceStrategy currently in use.
void setExternalGeneralEntities (bool flag=true)
void setExternalParameterEntities (bool flag=true)
 Returns true if external general entities will be processed; false otherwise.
void setLexicalHandler (LexicalHandler *pLexicalHandler)
 Return the current content handler.
void setNamespaceStrategy (NamespaceStrategy *pStrategy)
 Adds an encoding to the parser.
 ~ParserEngine ()

Protected Member Functions

void handleError (int errorNo)
 Parses an entity from the given stream.
void init ()
 Return the column number where the current document event ends.
const Locatorlocator () const
 Resets and clears the context stack.
void parseByteInputStream (XMLByteInputStream &istr)
 initializes expat
void parseCharInputStream (XMLCharInputStream &istr)
 Parses an entity from the given stream.
void parseExternal (XML_Parser extParser, InputSource *pInputSource)
void parseExternalByteInputStream (XML_Parser extParser, XMLByteInputStream &istr)
 Parse an XML document from the given InputSource.
void parseExternalCharInputStream (XML_Parser extParser, XMLCharInputStream &istr)
 Parses an external entity from the given stream, with a separate parser.
void popContext ()
 Pushes a new entry to the context stack.
void pushContext (XML_Parser parser, InputSource *pInputSource)
 Parses an external entity from the given stream, with a separate parser.
void resetContext ()
 Pops the top-most entry from the context stack.

Static Protected Member Functions

static int convert (void *data, const char *s)
static void handleCharacterData (void *userData, const XML_Char *s, int len)
static void handleComment (void *userData, const XML_Char *data)
static void handleDefault (void *userData, const XML_Char *s, int len)
static void handleEndCdataSection (void *userData)
static void handleEndDoctypeDecl (void *userData)
static void handleEndElement (void *userData, const XML_Char *name)
static void handleEndNamespaceDecl (void *userData, const XML_Char *prefix)
static void handleEntityDecl (void *userData, const XML_Char *entityName, int isParamEntity, const XML_Char *value, int valueLength, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId, const XML_Char *notationName)
static int handleExternalEntityRef (XML_Parser parser, const XML_Char *openEntityNames, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId)
static void handleExternalParsedEntityDecl (void *userData, const XML_Char *entityName, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId)
static void handleInternalParsedEntityDecl (void *userData, const XML_Char *entityName, const XML_Char *replacementText, int replacementTextLength)
static void handleNotationDecl (void *userData, const XML_Char *notationName, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId)
static void handleProcessingInstruction (void *userData, const XML_Char *target, const XML_Char *data)
static void handleSkippedEntity (void *userData, const XML_Char *entityName, int isParameterEntity)
static void handleStartCdataSection (void *userData)
static void handleStartDoctypeDecl (void *userData, const XML_Char *doctypeName, const XML_Char *systemId, const XML_Char *publicId, int hasInternalSubset)
static void handleStartElement (void *userData, const XML_Char *name, const XML_Char **atts)
 Returns a locator denoting the current parse location.
static void handleStartNamespaceDecl (void *userData, const XML_Char *prefix, const XML_Char *uri)
static int handleUnknownEncoding (void *encodingHandlerData, const XML_Char *name, XML_Encoding *info)
static void handleUnparsedEntityDecl (void *userData, const XML_Char *entityName, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId, const XML_Char *notationName)

Private Types

typedef std::vector
< ContextLocator * > 
ContextStack
typedef std::map< XMLString,
Poco::TextEncoding * > 
EncodingMap

Private Attributes

ContextStack _context
XMLString _encoding
EncodingMap _encodings
bool _encodingSpecified
bool _expandInternalEntities
bool _externalGeneralEntities
bool _externalParameterEntities
XML_Parser _parser
char * _pBuffer
ContentHandler_pContentHandler
DeclHandler_pDeclHandler
DTDHandler_pDTDHandler
EntityResolver_pEntityResolver
ErrorHandler_pErrorHandler
LexicalHandler_pLexicalHandler
NamespaceStrategy_pNamespaceStrategy

Static Private Attributes

static const XMLString EMPTY_STRING
static const int PARSE_BUFFER_SIZE = 4096

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index