|
Unicorn XML Toolkit Version 1.50.00 |
|||||||||
� PREV CLASS �� NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|� DATA | DETAIL: � CONSTR �|� FUNCTION �|� DATA |
class CXmlReader: virtual public CInterface { public: static const WCHAR m_szNamespaces[]; static const WCHAR m_szNamespacePrefixes[]; static const WCHAR m_szValidation[]; static const WCHAR m_szExternalGeneralEntities[]; static const WCHAR m_szExternalParameterEntities[]; public: CXmlReader(); virtual ~CXmlReader(); public: virtual void SetFeature( const WCHAR *pszName, bool bValue) = 0; virtual bool GetFeature(const WCHAR *pszName) = 0; virtual void SetProperty( const WCHAR *pszName, CInterface *pValue) = 0; virtual CInterface *GetProperty(const WCHAR *pszName) = 0; virtual void SetEntityResolver(CEntityResolver *pResolver) = 0; virtual CEntityResolver *GetEntityResolver() = 0; virtual void SetDtdHandler(CDtdHandler *pHandler) = 0; virtual CDtdHandler *GetDtdHandler() = 0; virtual void SetContentHandler(CContentHandler *pHandler) = 0; virtual CContentHandler *GetContentHandler() = 0; virtual void SetErrorHandler(CErrorHandler *pHandler) = 0; virtual CErrorHandler *GetErrorHandler() = 0; virtual void Parse(CInputSource *pInput) = 0; virtual void Parse(const WCHAR *pszSystemId) = 0; virtual bool SetNamespaces(bool bNamespaces) = 0; virtual bool GetNamespaces() = 0; virtual void SetInputSource(CInputSource *pInputSource) = 0; virtual CInputSource *GetInputSource() = 0; virtual void Start() = 0; }; typedef XInterface<CXmlReader> XXmlReader;
The abstract interface for reading XML documents using callbacks.
This interface allows an application to set and query features and properties in the reader, to register event handlers for document processing, and to initiate a document parse.
All SAX interfaces are assumed to be synchronous: the
Parse
methods must not return until parsing
is complete, and readers must wait for an event-handler callback
to return before reporting the next event.
CDtdHandler, CEntityResolver, CContentHandler, CErrorHandler, CInputSource
Constructor/Destructor Summary | |
CXmlReader
();
����������Constructs the XML reader. |
|
~CXmlReader
();
����������Destroys the XML reader. |
Function Summary | |
void
|
SetFeature
(const WCHAR *pszName, bool bValue);
����������Sets the state of a feature. |
bool
|
GetFeature
(const WCHAR *pszName);
����������Looks up the value of a feature. |
void
|
SetProperty
(const WCHAR *pszName, CInterface *pValue);
����������Sets the value of a property. |
CInterface�*
|
GetProperty
(const WCHAR *pszName);
����������Looks up the value of a property. |
void
|
SetEntityResolver
(CEntityResolver *pResolver);
����������Allows an application to register an entity resolver. |
CEntityResolver�*
|
GetEntityResolver
();
����������Gets the current entity resolver. |
void
|
SetDtdHandler
(CDtdHandler *pHandler);
����������Allows an application to register a DTD event handler. |
CDtdHandler�*
|
GetDtdHandler
();
����������Gets the current DTD handler. |
void
|
SetContentHandler
(CContentHandler *pHandler);
����������Allows an application to register a content event handler. |
CContentHandler�*
|
GetContentHandler
();
����������Gets the current content handler. |
void
|
SetErrorHandler
(CErrorHandler *pHandler);
����������Allows an application to register an error event handler. |
CErrorHandler�*
|
GetErrorHandler
();
����������Gets the current error handler. |
void
|
Parse
(CInputSource *pInput);
����������Parses an XML document. |
void
|
Parse
(const WCHAR *pszSystemId);
����������Parses an XML document from a system identifier (URI). |
void
|
SetNamespaces
(bool bNamespaces);
����������Specifies whether content events generated by the reader provide namespace information. |
bool
|
GetNamespaces
();
����������Tests whether content events generated by the reader provide namespace information. |
void
|
SetInputSource
(CInputSource *pInputSource);
����������Sets the input source. |
CInputSource�*
|
GetInputSource
();
����������Gets the current input source. |
void
|
Start
();
����������Starts the SAX reader. |
Data Summary | |
const�WCHAR
|
m_szNamespaces
[];
����������The convenience identifier for the "http://xml.org/sax/features/namespaces"
feature name. |
const�WCHAR
|
m_szNamespacePrefixes
[];
����������The convenience identifier for the "http://xml.org/sax/features/namespace-prefixes"
feature name. |
const�WCHAR
|
m_szValidation
[];
����������The convenience identifier for the "http://xml.org/sax/features/validation"
feature name. |
const�WCHAR
|
m_szExternalGeneralEntities
[];
����������The convenience identifier for the "http://xml.org/sax/features/external-general-entities"
feature name. |
const�WCHAR
|
m_szExternalParameterEntities
[];
����������The convenience identifier for the "http://xml.org/sax/features/external-parameter-entities"
feature name. |
Constructor/Destructor Detail |
CXmlReader();
Constructs the XML reader.
virtual ~CXmlReader();
Destroys the XML reader.
Function Detail |
virtual void SetFeature( const WCHAR *pszName, bool bValue) = 0;
Sets the state of a feature.
The feature name is any fully-qualified URI. It is possible for an XML reader to recognize a feature name but to be unable to set its value; this is especially true in the case of an adapter for a non-SAX reader, which has no way of affecting whether the underlying reader is validating, for example.
All XML Readers are required to support setting
http://xml.org/sax/features/namespaces
to
true
and
http://xml.org/sax/features/namespace-prefixes
to
false
.
Some feature values may be immutable or mutable only in specific contexts, such as before, during, or after a parse.
pszName
- the feature name, which is a fully-qualified URIbValue
- the requested state of the feature
(
true
or
false
)virtual bool GetFeature(const WCHAR *pszName) = 0;
Looks up the value of a feature.
The feature name is any fully-qualified URI. It is possible for an XML reader to recognize a feature name but to be unable to return its value; this is especially true in the case of an adapter for a non-SAX reader, which has no way of knowing whether the underlying reader is performing validation or expanding external entities.
All XML Readers are required to recognize the
http://xml.org/sax/features/namespaces
and the
http://xml.org/sax/features/namespace-prefixes
feature names.
Some feature values may be available only in specific contexts, such as before, during, or after a parse.
Implementors are free (and encouraged) to invent their own features, using names built on their own URIs.
pszName
- the feature name, which is a fully-qualified URItrue
or
false
)virtual void SetProperty( const WCHAR *pszName, CInterface *pValue) = 0;
Sets the value of a property.
The property name is any fully-qualified URI. It is possible for an XML reader to recognize a property name but to be unable to set its value; this is especially true in the case of an adapter for a non-SAX reader.
XML Readers are not required to recognize setting any specific property names, though a core set is provided with SAX2.
Some property values may be immutable or mutable only in specific contexts, such as before, during, or after a parse.
This method is also the standard mechanism for setting extended handlers.
pszName
- the property name, which is a fully-qualified URIpValue
- the requested value for the property,
which is an interface pointervirtual CInterface *GetProperty(const WCHAR *pszName) = 0;
Looks up the value of a property.
The property name is any fully-qualified URI. It is possible for an XML reader to recognize a property name but to be unable to return its state; this is especially true in the case of an adapter for a non-SAX reader.
XML Readers are not required to recognize any specific property names, though an initial core set is documented for SAX2.
Some property values may be available only in specific contexts, such as before, during, or after a parse.
Implementors are free (and encouraged) to invent their own properties, using names built on their own URIs.
pszName
- the property name, which is a fully-qualified URIvirtual void SetEntityResolver(CEntityResolver *pResolver) = 0;
Allows an application to register an entity resolver.
If the application does not register an entity resolver, the XML reader will perform its own default resolution.
Applications may register a new or different resolver in the middle of a parse, and the SAX reader must begin using the new resolver immediately.
pResolver
- the entity resolvervirtual CEntityResolver *GetEntityResolver() = 0;
Gets the current entity resolver.
NULL
if none has been registeredvirtual void SetDtdHandler(CDtdHandler *pHandler) = 0;
Allows an application to register a DTD event handler.
If the application does not register a DTD handler, all DTD events reported by the SAX reader will be silently ignored.
Applications may register a new or different handler in the middle of a parse, and the SAX reader must begin using the new handler immediately.
pHandler
- the DTD handlervirtual CDtdHandler *GetDtdHandler() = 0;
Gets the current DTD handler.
NULL
if none has been registeredvirtual void SetContentHandler(CContentHandler *pHandler) = 0;
Allows an application to register a content event handler.
If the application does not register a content handler, all content events reported by the SAX reader will be silently ignored.
Applications may register a new or different handler in the middle of a parse, and the SAX reader must begin using the new handler immediately.
pHandler
- the content handlervirtual CContentHandler *GetContentHandler() = 0;
Gets the current content handler.
NULL
if none has been registeredvirtual void SetErrorHandler(CErrorHandler *pHandler) = 0;
Allows an application to register an error event handler.
If the application does not register an error handler, all error events reported by the SAX reader will be silently ignored; however, normal processing may not continue. It is highly recommended that all SAX applications implement an error handler to avoid unexpected bugs.
Applications may register a new or different handler in the middle of a parse, and the SAX reader must begin using the new handler immediately.
pHandler
- the error handlervirtual CErrorHandler *GetErrorHandler() = 0;
Gets the current error handler.
NULL
if none has been registeredvirtual void Parse(CInputSource *pInput) = 0;
Parses an XML document.
The application can use this method to instruct the XML reader to begin parsing an XML document from any valid input source (a character stream, a byte stream, or a URI).
Applications may not invoke this method while a parse is in progress (they should create a new XMLReader instead for each nested XML document). Once a parse is complete, an application may reuse the same XML reader object, possibly with a different input source.
During the parse, the XML reader will provide information about the XML document through the registered event handlers.
This method is synchronous: it will not return until parsing has ended. If a client application wants to terminate parsing early, it should throw an exception.
pInput
- the input source for
the top-level of the XML documentvirtual void Parse(const WCHAR *pszSystemId) = 0;
Parses an XML document from a system identifier (URI).
This method is a shortcut for the common case of reading a document from a system identifier.
If the system identifier is a URL, it must be fully resolved by the application before it is passed to the reader.
pszSystemId
- the system identifier (URI)virtual void SetNamespaces(bool bNamespaces) = 0;
Specifies whether content events generated by the reader provide namespace information.
bNamespaces
-
true
if content events
generated by this reader must provide namespace information;
false
otherwisevirtual bool GetNamespaces() = 0;
Tests whether content events generated by the reader provide namespace information.
true
if content events
generated by this reader provide namespace information;
false
otherwisevirtual void SetInputSource(CInputSource *pInputSource) = 0;
Sets the input source.
This method is useful when the parsing is started
using the
Start
method.
pInputSource
- the input sourcevirtual CInputSource *GetInputSource() = 0;
Gets the current input source.
NULL
if none has been registeredvirtual void Start() = 0;
Starts the SAX reader.
When started, the SAX reader will provide information about the XML document through the registered content handler.
This method is synchronous: it will not return until reading has ended. If a client application wants to terminate the reader early, it should throw an exception.
Data Detail |
static const WCHAR m_szNamespaces[];
The convenience identifier for the
"http://xml.org/sax/features/namespaces"
feature name.
This feature controls namespace processing.
static const WCHAR m_szNamespacePrefixes[];
The convenience identifier for the
"http://xml.org/sax/features/namespace-prefixes"
feature name.
This feature controls reporting the original prefixed names and attributes used for namespace declarations.
static const WCHAR m_szValidation[];
The convenience identifier for the
"http://xml.org/sax/features/validation"
feature name.
This feature controls reporting validation errors (implies
external-general-entities
and
external-parameter-entities
).
static const WCHAR m_szExternalGeneralEntities[];
The convenience identifier for the
"http://xml.org/sax/features/external-general-entities"
feature name.
This feature controls inclusion of external general (text) entities.
static const WCHAR m_szExternalParameterEntities[];
The convenience identifier for the
"http://xml.org/sax/features/external-parameter-entities"
feature name.
This feature controls inclusion of external parameter entities, including the external DTD subset.
|
Unicorn XML Toolkit Version 1.50.00 |
|||||||||
� PREV CLASS �� NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|� DATA | DETAIL: � CONSTR �|� FUNCTION �|� DATA |