ACEXML  6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ACEXML_Parser Class Reference

A SAX based parser. More...

#include "ACEXML/parser/parser/Parser.h"

Inheritance diagram for ACEXML_Parser:
Inheritance graph
Collaboration diagram for ACEXML_Parser:
Collaboration graph

Public Member Functions

 ACEXML_Parser (void)
 Default constructor.
 
virtual ~ACEXML_Parser (void)
 Destructor.
 
int initialize (ACEXML_InputSource *input)
 
virtual ACEXML_ContentHandlergetContentHandler (void) const
 
virtual ACEXML_DTDHandlergetDTDHandler (void) const
 
virtual ACEXML_EntityResolvergetEntityResolver (void) const
 
virtual ACEXML_ErrorHandlergetErrorHandler (void) const
 
virtual int getFeature (const ACEXML_Char *name)
 
virtual void setFeature (const ACEXML_Char *name, int boolean_value)
 
virtual void * getProperty (const ACEXML_Char *name)
 
virtual void setProperty (const ACEXML_Char *name, void *value)
 
virtual void parse (ACEXML_InputSource *input)
 
virtual void parse (const ACEXML_Char *systemId)
 
virtual void setContentHandler (ACEXML_ContentHandler *handler)
 
virtual void setDTDHandler (ACEXML_DTDHandler *handler)
 
virtual void setEntityResolver (ACEXML_EntityResolver *resolver)
 
virtual void setErrorHandler (ACEXML_ErrorHandler *handler)
 
- Public Member Functions inherited from ACEXML_XMLReader
virtual ~ACEXML_XMLReader (void)
 

Protected Member Functions

void parse_xml_prolog (void)
 
void parse_version_info (void)
 
void parse_encoding_decl (void)
 
void parse_xml_decl (void)
 
int parse_text_decl (void)
 
int parse_processing_instruction (void)
 
int parse_doctypedecl (void)
 
void parse_element (int is_root)
 
int parse_content (const ACEXML_Char *startname, const ACEXML_Char *&ns_uri, const ACEXML_Char *&ns_lname, int ns_flag)
 
int parse_char_reference (ACEXML_Char *buf, size_t &len)
 
ACEXML_Charparse_reference_name (void)
 
int parse_cdata (void)
 
int parse_internal_dtd (void)
 
int parse_comment (void)
 
int parse_element_decl (void)
 
int parse_entity_decl (void)
 
int parse_attlist_decl (void)
 
int parse_atttype (void)
 
int parse_notation_decl (void)
 
int parse_external_id (ACEXML_Char *&publicId, ACEXML_Char *&systemId)
 
int parse_external_dtd (void)
 
int parse_external_subset (void)
 
int parse_markup_decl (void)
 
int parse_conditional_section (void)
 
int parse_includesect (void)
 
int parse_ignoresect (void)
 
int parse_PE_reference (void)
 
int parse_entity_reference (void)
 
int parse_entity_value (ACEXML_Char *&str)
 
int parse_defaultdecl (void)
 
int parse_children_definition (void)
 
int parse_child (int skip_open_paren)
 
ACEXML_Charparse_name (ACEXML_Char ch=0)
 
ACEXML_Charparse_nmtoken (ACEXML_Char ch=0)
 
int parse_version (ACEXML_Char *&str)
 
int parse_version_num (ACEXML_Char *&str)
 
int parse_encname (ACEXML_Char *&str)
 
int parse_sddecl (ACEXML_Char *&str)
 
ACEXML_Charparse_attname (void)
 
int parse_attvalue (ACEXML_Char *&str)
 
int parse_tokenized_type (void)
 
int parse_system_literal (ACEXML_Char *&str)
 
int parse_pubid_literal (ACEXML_Char *&str)
 
int is_whitespace (const ACEXML_Char c) const
 
int isChar (ACEXML_UCS4 c) const
 
int isCharRef (const ACEXML_Char c) const
 
int isBasechar (const ACEXML_Char c) const
 
int isIdeographic (const ACEXML_Char c) const
 
int isCombiningchar (const ACEXML_Char c) const
 
int isDigit (const ACEXML_Char c) const
 
int isExtender (const ACEXML_Char c) const
 
int isLetter (const ACEXML_Char c) const
 
int isNameChar (const ACEXML_Char c) const
 
int isPubidChar (const ACEXML_Char c) const
 
virtual ACEXML_Char get (void)
 Get a character.
 
virtual ACEXML_Char peek (void)
 Peek a character.
 

Private Member Functions

ACEXML_Char skip_whitespace (void)
 
int skip_whitespace_count (ACEXML_Char *peek=0)
 
int skip_equal (void)
 
int get_quoted_string (ACEXML_Char *&str)
 
int isNormalDigit (const ACEXML_Char c) const
 
void error (const ACEXML_Char *msg)
 
void warning (const ACEXML_Char *msg)
 
void fatal_error (const ACEXML_Char *msg)
 
void prefix_mapping (const ACEXML_Char *prefix, const ACEXML_Char *uri, int start)
 
int parse_token (const ACEXML_Char *keyword)
 
int push_context (ACEXML_Parser_Context *context)
 
size_t pop_context (int GE_ref)
 
virtual int switch_input (ACEXML_CharStream *cstream, const ACEXML_Char *systemId, const ACEXML_Char *publicId=0)
 
virtual int switch_input (ACEXML_InputSource *input, const ACEXML_Char *systemId, const ACEXML_Char *publicId=0)
 
int check_for_PE_reference (void)
 
void reset (void)
 
ACEXML_Charnormalize_systemid (const ACEXML_Char *systemId)
 

Private Attributes

ACEXML_DTDHandlerdtd_handler_
 
ACEXML_EntityResolverentity_resolver_
 
ACEXML_ContentHandlercontent_handler_
 
ACEXML_ErrorHandlererror_handler_
 
ACEXML_Chardoctype_
 Document Type.
 
ACEXML_Parser_Contextcurrent_
 Current parser context.
 
ACE_Unbounded_Stack
< ACEXML_Parser_Context * > 
ctx_stack_
 Stack used to hold the Parser_Context.
 
ACE_Unbounded_Stack
< ACEXML_Char * > 
GE_reference_
 Set used to hold the general entity references that are active.
 
ACE_Unbounded_Stack
< ACEXML_Char * > 
PE_reference_
 Set used to hold the parameter entity references that are active.
 
ACE_Obstack_T< ACEXML_Charobstack_
 Obstack used by the parser to hold all the strings parsed.
 
ACE_Obstack_T< ACEXML_Charalt_stack_
 Alternative obstack used to hold any strings when the original is in use.
 
ACEXML_NamespaceSupport xml_namespace_
 Namespace stack used by the parser to implement support for Namespaces.
 
int nested_namespace_
 T => We are processing a nested namespace.
 
ACEXML_Entity_Manager internal_GE_
 Set of internal parsed general entities in the document.
 
ACEXML_Entity_Manager external_GE_
 Set of external parsed general entities in the document.
 
ACEXML_Entity_Manager unparsed_entities_
 Set of unparsed entities in the document.
 
ACEXML_Entity_Manager predef_entities_
 Set of predefined entities used by the parser.
 
ACEXML_Entity_Manager internal_PE_
 Set of internal parsed parameter entities in the document.
 
ACEXML_Entity_Manager external_PE_
 Set of external parsed parameter entities in the document.
 
ACEXML_Entity_Manager notations_
 Set of notations declared in the document.
 
ACEXML_ParserInt::ReferenceState ref_state_
 State of the parser when it encounters a reference.
 
int external_subset_
 T => We are parsing an external subset.
 
int external_entity_
 T => We are parsing an external entity value.
 
int has_pe_refs_
 T => Internal DTD has parameter entity references.
 
int standalone_
 If set, the document is a standalone XML document.
 
int external_dtd_
 If set, the document has an external DTD subset.
 
int internal_dtd_
 If set, the document has an internal DTD.
 
int simple_parsing_
 
int validate_
 If set, the parser should also validate.
 
int namespaces_
 If set, the parser should allow access by namespace qualified names.
 
int namespace_prefixes_
 

Static Private Attributes

static const ACEXML_Char simple_parsing_feature_ [] = ACE_TEXT ("Simple")
 
static const ACEXML_Char namespaces_feature_ [] = ACE_TEXT ("http://xml.org/sax/features/namespaces")
 
static const ACEXML_Char namespace_prefixes_feature_ [] = ACE_TEXT ("http://xml.org/sax/features/namespace-prefixes")
 
static const ACEXML_Char validation_feature_ [] = ACE_TEXT ("http://xml.org/sax/features/validation")
 

Detailed Description

A SAX based parser.

Constructor & Destructor Documentation

ACEXML_Parser::ACEXML_Parser ( void  )

Default constructor.

ACEXML_Parser::~ACEXML_Parser ( void  )
virtual

Destructor.

Member Function Documentation

int ACEXML_Parser::check_for_PE_reference ( void  )
private

Check for a parameter entity reference. This is used to check for the occurrence of a PE Reference withing markupDecl. Additionally this function consumes any leading or trailing whitespace around the PE Reference.

Return values
Numberof whitespace characters skipped.
void ACEXML_Parser::error ( const ACEXML_Char msg)
private

Dispatch errors to ErrorHandler.

void ACEXML_Parser::fatal_error ( const ACEXML_Char msg)
private

Dispatch fatal errors to ErrorHandler.

ACEXML_INLINE ACEXML_Char ACEXML_Parser::get ( void  )
protectedvirtual

Get a character.

int ACEXML_Parser::get_quoted_string ( ACEXML_Char *&  str)
private

Get a quoted string. Quoted strings are used to specify attribute values and this routine will replace character and entity references on-the-fly. Parameter entities are not allowed (or replaced) in this function. (But regular entities are.)

Parameters
strreturns the un-quoted string.
Return values
0on success, -1 otherwise.
ACEXML_INLINE ACEXML_ContentHandler * ACEXML_Parser::getContentHandler ( void  ) const
virtual

Return the current content handler.

Implements ACEXML_XMLReader.

ACEXML_INLINE ACEXML_DTDHandler * ACEXML_Parser::getDTDHandler ( void  ) const
virtual

Return the current DTD handler.

Implements ACEXML_XMLReader.

ACEXML_INLINE ACEXML_EntityResolver * ACEXML_Parser::getEntityResolver ( void  ) const
virtual

Return the current entity resolver.

Implements ACEXML_XMLReader.

ACEXML_INLINE ACEXML_ErrorHandler * ACEXML_Parser::getErrorHandler ( void  ) const
virtual

Return the current error handler.

Implements ACEXML_XMLReader.

int ACEXML_Parser::getFeature ( const ACEXML_Char name)
virtual

Look up the value of a feature. This method allows programmers to check whether a specific feature has been activated in the parser.

Implements ACEXML_XMLReader.

void * ACEXML_Parser::getProperty ( const ACEXML_Char name)
virtual

Look up the value of a property.

Implements ACEXML_XMLReader.

int ACEXML_Parser::initialize ( ACEXML_InputSource input)

Initialize the parser state.

Return values
0if parser was initialized correctly else -1.
ACEXML_INLINE int ACEXML_Parser::is_whitespace ( const ACEXML_Char  c) const
protected

Check if a character c is a whitespace.

Return values
1if c is a valid white space character. 0 otherwise.
ACEXML_INLINE int ACEXML_Parser::isBasechar ( const ACEXML_Char  c) const
protected

Check if a character c is a BaseChar.

Return values
1if c is a valid BaseChar character, 0 otherwise.
ACEXML_INLINE int ACEXML_Parser::isChar ( ACEXML_UCS4  c) const
protected

Check if a character c is a valid Char.

Return values
1if c is a valid character. 0 otherwise.
ACEXML_INLINE int ACEXML_Parser::isCharRef ( const ACEXML_Char  c) const
protected

Check if a character c is a valid CharRef character.

Return values
1if c is a valid character reference character, 0 otherwise.
ACEXML_INLINE int ACEXML_Parser::isCombiningchar ( const ACEXML_Char  c) const
protected

Check if a character c is a CombiningChar.

Return values
1if c is a valid CombiningChar character, 0 otherwise.
ACEXML_INLINE int ACEXML_Parser::isDigit ( const ACEXML_Char  c) const
protected

Check if a character c is a Digit.

Return values
1if c is a valid Digit character, 0 otherwise.
ACEXML_INLINE int ACEXML_Parser::isExtender ( const ACEXML_Char  c) const
protected

Check if a character c is an Extender.

Return values
1if c is a valid Extender character, 0 otherwise.
ACEXML_INLINE int ACEXML_Parser::isIdeographic ( const ACEXML_Char  c) const
protected

Check if a character c is a Ideographic.

Return values
1if c is a valid Ideographic character, 0 otherwise.
ACEXML_INLINE int ACEXML_Parser::isLetter ( const ACEXML_Char  c) const
protected

Check if a character c is a Letter.

Return values
1if c is a valid Letter character, 0 otherwise.
ACEXML_INLINE int ACEXML_Parser::isNameChar ( const ACEXML_Char  c) const
protected

Check if a character is an acceptable NameChar.

Return values
1if c is a valid NameChar character, 0 otherwise.
ACEXML_INLINE int ACEXML_Parser::isNormalDigit ( const ACEXML_Char  c) const
private

Check if a character c is a Digit.

Return values
1if c is a valid Digit character, 0 otherwise.
ACEXML_INLINE int ACEXML_Parser::isPubidChar ( const ACEXML_Char  c) const
protected

Check if a character is a PubidChar.

Return values
1if c is a valid PubidChar character, 0 otherwise.
ACEXML_Char * ACEXML_Parser::normalize_systemid ( const ACEXML_Char systemId)
private

Very trivial, non-conformant normalization of a systemid.

void ACEXML_Parser::parse ( ACEXML_InputSource input)
virtual

Parse an XML document.

Implements ACEXML_XMLReader.

void ACEXML_Parser::parse ( const ACEXML_Char systemId)
virtual

Parse an XML document from a system identifier (URI).

Implements ACEXML_XMLReader.

int ACEXML_Parser::parse_attlist_decl ( void  )
protected

Parse an "ATTLIST" decl. Thse first character this method expects is always the 'A' (the first char) in the word "ATTLIST".

Return values
0on success, -1 otherwise.
ACEXML_Char * ACEXML_Parser::parse_attname ( void  )
protected

Parse an attribute name.

Return values
strString containing the value of the attribute name if successful.
0otherwise.
int ACEXML_Parser::parse_atttype ( void  )
protected

Parse a AttType declaration.

AttType ::= StringType | TokenizedType | EnumeratedType StringType ::= 'CDATA' TokenizedType ::= 'ID' [VC: ID] [VC: One ID per Element Type] [VC: ID Attribute Default] | 'IDREF' [VC: IDREF] | 'IDREFS' [VC: IDREF] | 'ENTITY' [VC: Entity Name] | 'ENTITIES' [VC: Entity Name] | 'NMTOKEN' [VC: Name Token] | 'NMTOKENS'

EnumeratedType ::= NotationType | Enumeration NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')' [VC: Notation Attributes] [VC: One Notation Per Element Type] [VC: No Notation on Empty Element] Enumeration ::= '(' S? Nmtoken (S? '|' S? Nmtoken)* S? ')' [VC: Enumeration]

int ACEXML_Parser::parse_attvalue ( ACEXML_Char *&  str)
protected

Parse an attribute value.

Parameters
strString containing the value of the attribute if successful.
Returns
0 if attribute value was read successfully, -1 otherwise.
int ACEXML_Parser::parse_cdata ( void  )
protected

Parse a CDATA section. The first character should always be the first '[' in CDATA definition.

Return values
0on success.
-1if fail.
int ACEXML_Parser::parse_char_reference ( ACEXML_Char buf,
size_t &  len 
)
protected

Parse a character reference, i.e., "&#x20;" or "&#30;". The first character encountered should be the '#' char.

Parameters
bufpoints to a character buffer for the result.
lenIn/out argument which initially specifies the size of the buffer and is later set to the no. of characters in the reference.
Return values
0on success and -1 otherwise.
int ACEXML_Parser::parse_child ( int  skip_open_paren)
protected

Parse a cp non-terminal. cp can either be a seq or a choice. This function calls itself recursively.

Parameters
skip_open_parenwhen non-zero, it indicates that the open paren of the seq or choice has already been removed from the input stream.
Return values
0on success, -1 otherwise.
int ACEXML_Parser::parse_children_definition ( void  )
protected

Parse the "children" and "Mixed" non-terminals in contentspec.

The first character this function sees must be the first open paren '(' in children.

Return values
0on success, -1 otherwise.
int ACEXML_Parser::parse_comment ( void  )
protected

Skip over a comment. The first character encountered should always be the first '-' in the comment prefix "@<@!&ndash;".

int ACEXML_Parser::parse_conditional_section ( void  )
protected

Parse a conditionalSect declaration.

int ACEXML_Parser::parse_content ( const ACEXML_Char startname,
const ACEXML_Char *&  ns_uri,
const ACEXML_Char *&  ns_lname,
int  ns_flag 
)
protected

Parse a content declaration.

int ACEXML_Parser::parse_defaultdecl ( void  )
protected

Parse a DefaultDecl specification.

int ACEXML_Parser::parse_doctypedecl ( void  )
protected

Parse the DOCTYPE declaration. The first character encountered should always be 'D' in doctype prefix: "@<@!DOCTYPE".

void ACEXML_Parser::parse_element ( int  is_root)
protected

Parse an XML element. The first character encountered should be the first character of the element "Name".

Parameters
is_rootIf not 0, then we are expecting to see the "root" element now, and the next element's name need to match the name defined in DOCTYPE definition, i.e., this->doctype_.
Todo:
Instead of simply checking for the root element based on the argument is_root, we should instead either pass in some sort of validator or allow the function to return the element name so it can be used in a validator.
int ACEXML_Parser::parse_element_decl ( void  )
protected

Parse an "ELEMENT" decl. The first character this method expects is always the 'L' (the second char) in the word "ELEMENT".

Return values
0on success, -1 otherwise.
int ACEXML_Parser::parse_encname ( ACEXML_Char *&  str)
protected

Parse the encoding name in an XML Prolog section.

Parameters
strString containing the encoding name if successful.
Returns
0 if the string was read successfully, 0 otherwise.
void ACEXML_Parser::parse_encoding_decl ( void  )
protected

Parse a EncodingDecl declaration.

int ACEXML_Parser::parse_entity_decl ( void  )
protected

Parse an "ENTITY" decl. The first character this method expects is always the 'N' (the second char) in the word "ENTITY".

Return values
0on success, -1 otherwise.
int ACEXML_Parser::parse_entity_reference ( void  )
protected

Parse a Reference.

int ACEXML_Parser::parse_entity_value ( ACEXML_Char *&  str)
protected

Parse an entityValue.

int ACEXML_Parser::parse_external_dtd ( void  )
protected

Parse an external DTD.

int ACEXML_Parser::parse_external_id ( ACEXML_Char *&  publicId,
ACEXML_Char *&  systemId 
)
protected

Parse an ExternalID or a reference to PUBLIC ExternalID. Possible cases are in the forms of:

SYSTEM 'quoted string representing system resource' PUBLIC 'quoted name of public ID' 'quoted resource' PUBLIC 'quoted name we are referring to'

The first character this function sees must be either 'S' or 'P'. When the function finishes parsing, the input stream points at the first non-whitespace character.

Parameters
publicIdreturns the unquoted publicId read. If none is available, it will be reset to 0.
systemIdreturns the unquoted systemId read. If none is available, it will be reset to 0.
Return values
0on success, -1 otherwise.
int ACEXML_Parser::parse_external_subset ( void  )
protected

Parse an external subset. This does the actual parsing of an external subset and is called by

See Also
parse_external_dtd.
int ACEXML_Parser::parse_ignoresect ( void  )
protected

Parse a ignoreSect declaration.

int ACEXML_Parser::parse_includesect ( void  )
protected

Parse a includeSect declaration.

int ACEXML_Parser::parse_internal_dtd ( void  )
protected

Parse a "markupdecl" section, this includes both "markupdecl" and "DeclSep" sections in XML specification

int ACEXML_Parser::parse_markup_decl ( void  )
protected

Parse a markupDecl section.

ACEXML_Char * ACEXML_Parser::parse_name ( ACEXML_Char  ch = 0)
protected

Parse a name from the input CharStream. If ch @!= 0, then we have already consumed the first name character from the input CharStream, otherwise, parse_name will use this->get() to acquire the initial character.

Returns
A pointer to the string in the obstack, 0 if it's not a valid name.
ACEXML_Char * ACEXML_Parser::parse_nmtoken ( ACEXML_Char  ch = 0)
protected

Parse a NMTOKEN from the input stream.

Returns
A pointer to the string in the obstack, 0 if it's not a valid NMTOKEN.
int ACEXML_Parser::parse_notation_decl ( void  )
protected

*Parse a "NOTATION" decl. The first character this method expects is always the 'N' (the first char) in the word "NOTATION".

Return values
0on success, -1 otherwise.
int ACEXML_Parser::parse_PE_reference ( void  )
protected

Parse a PEReference.

int ACEXML_Parser::parse_processing_instruction ( void  )
protected

Parse a PI statement. The first character encountered should always be '?' in the PI prefix "@<?".

Return values
0on success, -1 otherwise.
int ACEXML_Parser::parse_pubid_literal ( ACEXML_Char *&  str)
protected

Parse a PubidLiteral.

Parameters
strString containing the PubidLiteral if successful.
Returns
0 if the string was read successfully, 0 otherwise.
ACEXML_Char * ACEXML_Parser::parse_reference_name ( void  )
protected

Parse a reference name, i.e., foo in "&foo;" or "%foo;". The first character encountered should be the character following '&' or ''. Effectively the same as

See Also
parse_name but we don't use the parser's obstack. Caller is responsible for deleting the memory.
Return values
Apointer to name of reference, 0 otherwise.
int ACEXML_Parser::parse_sddecl ( ACEXML_Char *&  str)
protected

Parse a SDDecl string.

Parameters
strString containing the encoding name if successful.
Returns
0 if the string was read successfully, -1 otherwise.
int ACEXML_Parser::parse_system_literal ( ACEXML_Char *&  str)
protected

Parse a SystemLiteral.

Parameters
strString containing the SystemLiteral if successful.
Returns
0 if the string was read successfully, 0 otherwise.
int ACEXML_Parser::parse_text_decl ( void  )
protected

Parse a TextDecl declaration.

ACEXML_INLINE int ACEXML_Parser::parse_token ( const ACEXML_Char keyword)
private

Parse a keyword.

int ACEXML_Parser::parse_tokenized_type ( void  )
protected

Parse a tokenized type attribute.

Returns
0 if attribute type was read successfully, -1 otherwise.
int ACEXML_Parser::parse_version ( ACEXML_Char *&  str)
protected

Parse the version string in an XML Prolog section.

Parameters
strString containing the version number if successful.
Returns
0 if the string was read successfully, 0 otherwise.
void ACEXML_Parser::parse_version_info ( void  )
protected

Parse VersionInfo declaration.

int ACEXML_Parser::parse_version_num ( ACEXML_Char *&  str)
protected

Parse the version number in a VersionInfo declaration.

void ACEXML_Parser::parse_xml_decl ( void  )
protected

Parse a XMLDecl declaration.

void ACEXML_Parser::parse_xml_prolog ( void  )
protected

Parse XML Prolog.

ACEXML_INLINE ACEXML_Char ACEXML_Parser::peek ( void  )
protectedvirtual

Peek a character.

size_t ACEXML_Parser::pop_context ( int  GE_ref)
private

Pop the top element in the stack and replace current context with that.

void ACEXML_Parser::prefix_mapping ( const ACEXML_Char prefix,
const ACEXML_Char uri,
int  start 
)
private

Dispatch prefix mapping calls to the ContentHandler.

Parameters
prefixNamespace prefix
uriNamespace URI
nameLocal name
start1 => startPrefixMapping 0 => endPrefixMapping
int ACEXML_Parser::push_context ( ACEXML_Parser_Context context)
private

Push the current context on to the stack.

void ACEXML_Parser::reset ( void  )
private

Reset the parser state.

ACEXML_INLINE void ACEXML_Parser::setContentHandler ( ACEXML_ContentHandler handler)
virtual

Allow an application to register a content event handler.

Implements ACEXML_XMLReader.

ACEXML_INLINE void ACEXML_Parser::setDTDHandler ( ACEXML_DTDHandler handler)
virtual

Allow an application to register a DTD event handler.

Implements ACEXML_XMLReader.

ACEXML_INLINE void ACEXML_Parser::setEntityResolver ( ACEXML_EntityResolver resolver)
virtual

Allow an application to register an entity resolver.

Implements ACEXML_XMLReader.

ACEXML_INLINE void ACEXML_Parser::setErrorHandler ( ACEXML_ErrorHandler handler)
virtual

Allow an application to register an error event handler.

Implements ACEXML_XMLReader.

void ACEXML_Parser::setFeature ( const ACEXML_Char name,
int  boolean_value 
)
virtual

Activating or deactivating a feature.

Implements ACEXML_XMLReader.

void ACEXML_Parser::setProperty ( const ACEXML_Char name,
void *  value 
)
virtual

Set the value of a property.

Implements ACEXML_XMLReader.

ACEXML_INLINE int ACEXML_Parser::skip_equal ( void  )
private

Skip an equal sign.

Return values
0when succeeds, -1 if no equal sign is found.
ACEXML_INLINE ACEXML_Char ACEXML_Parser::skip_whitespace ( void  )
private

Skip any whitespaces encountered until the first non-whitespace character is encountered.

Returns
The next non-whitespace character from the CharStream.
See Also
skip_whitespace_count
ACEXML_INLINE int ACEXML_Parser::skip_whitespace_count ( ACEXML_Char peek = 0)
private

Skip any whitespaces encountered until the first non-whitespace character. The first non-whitespace character is not consumed. This method does peek into the input CharStream and therefore is more expensive than skip_whitespace.

Parameters
peekIf non-null, peek points to a ACEXML_Char where skip_whitespace_count stores the first non-whitespace character it sees (character is not removed from the stream.)
Returns
The number of whitespace characters consumed.
See Also
skip_whitespace
int ACEXML_Parser::switch_input ( ACEXML_CharStream cstream,
const ACEXML_Char systemId,
const ACEXML_Char publicId = 0 
)
privatevirtual

Create a new ACEXML_CharStream from systemId and publicId and replace the current input stream with the newly created stream.

int ACEXML_Parser::switch_input ( ACEXML_InputSource input,
const ACEXML_Char systemId,
const ACEXML_Char publicId = 0 
)
privatevirtual

Create a new ACEXML_InputSource from systemId and publicId and replace the current input source with the newly created InputSource.

void ACEXML_Parser::warning ( const ACEXML_Char msg)
private

Dispatch warnings to ErrorHandler.

Member Data Documentation

ACE_Obstack_T<ACEXML_Char> ACEXML_Parser::alt_stack_
private

Alternative obstack used to hold any strings when the original is in use.

ACEXML_ContentHandler* ACEXML_Parser::content_handler_
private
ACE_Unbounded_Stack<ACEXML_Parser_Context*> ACEXML_Parser::ctx_stack_
private

Stack used to hold the Parser_Context.

ACEXML_Parser_Context* ACEXML_Parser::current_
private

Current parser context.

ACEXML_Char* ACEXML_Parser::doctype_
private

Document Type.

ACEXML_DTDHandler* ACEXML_Parser::dtd_handler_
private

Keeping track of the handlers. We do not manage the memory for handlers.

ACEXML_EntityResolver* ACEXML_Parser::entity_resolver_
private
ACEXML_ErrorHandler* ACEXML_Parser::error_handler_
private
int ACEXML_Parser::external_dtd_
private

If set, the document has an external DTD subset.

int ACEXML_Parser::external_entity_
private

T => We are parsing an external entity value.

ACEXML_Entity_Manager ACEXML_Parser::external_GE_
private

Set of external parsed general entities in the document.

ACEXML_Entity_Manager ACEXML_Parser::external_PE_
private

Set of external parsed parameter entities in the document.

int ACEXML_Parser::external_subset_
private

T => We are parsing an external subset.

ACE_Unbounded_Stack<ACEXML_Char*> ACEXML_Parser::GE_reference_
private

Set used to hold the general entity references that are active.

int ACEXML_Parser::has_pe_refs_
private

T => Internal DTD has parameter entity references.

int ACEXML_Parser::internal_dtd_
private

If set, the document has an internal DTD.

ACEXML_Entity_Manager ACEXML_Parser::internal_GE_
private

Set of internal parsed general entities in the document.

ACEXML_Entity_Manager ACEXML_Parser::internal_PE_
private

Set of internal parsed parameter entities in the document.

int ACEXML_Parser::namespace_prefixes_
private

If set, the parser should include namespace declarations in the list of attributes of an element.

int ACEXML_Parser::namespaces_
private

If set, the parser should allow access by namespace qualified names.

int ACEXML_Parser::nested_namespace_
private

T => We are processing a nested namespace.

ACEXML_Entity_Manager ACEXML_Parser::notations_
private

Set of notations declared in the document.

ACE_Obstack_T<ACEXML_Char> ACEXML_Parser::obstack_
private

Obstack used by the parser to hold all the strings parsed.

ACE_Unbounded_Stack<ACEXML_Char*> ACEXML_Parser::PE_reference_
private

Set used to hold the parameter entity references that are active.

ACEXML_Entity_Manager ACEXML_Parser::predef_entities_
private

Set of predefined entities used by the parser.

ACEXML_ParserInt::ReferenceState ACEXML_Parser::ref_state_
private

State of the parser when it encounters a reference.

int ACEXML_Parser::simple_parsing_
private

Feature flags If set, the parser should parse a document without a prolog

int ACEXML_Parser::standalone_
private

If set, the document is a standalone XML document.

ACEXML_Entity_Manager ACEXML_Parser::unparsed_entities_
private

Set of unparsed entities in the document.

int ACEXML_Parser::validate_
private

If set, the parser should also validate.

ACEXML_NamespaceSupport ACEXML_Parser::xml_namespace_
private

Namespace stack used by the parser to implement support for Namespaces.


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