|
Unicorn XML Toolkit Version 1.00.00 |
|||||||||
� PREV CLASS ��NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |
class CXmlFilterImpl: virtual public CXmlFilter, virtual public CEntityResolver, virtual public CDtdHandler, virtual public CContentHandler, virtual public CErrorHandler { public: CXmlFilterImpl(); CXmlFilterImpl(const XXmlReader &pParent); ~CXmlFilterImpl(); public: void SetParent(const XXmlReader &pParent); XXmlReader GetParent(); public: void SetFeature(const CString &strName, bool bValue); bool GetFeature(const CString &strName); void SetProperty( const CString &strName, CInterface *pValue); CInterface *GetProperty(const CString &strName); void SetEntityResolver(const XEntityResolver &pResolver); XEntityResolver GetEntityResolver(); void SetDtdHandler(const XDtdHandler &pHandler); XDtdHandler GetDtdHandler(); void SetContentHandler(const XContentHandler &pHandler); XContentHandler GetContentHandler(); void SetErrorHandler(const XErrorHandler &pHandler); XErrorHandler GetErrorHandler(); void Parse(const XInputSource &pInput); void Parse(const CString &strSystemId); bool GetNamespaces(); void SetInputSource(const XInputSource &pInput); XInputSource GetInputSource(); void Start(); public: XInputSource ResolveEntity( const CString &strPublicId, const CString &strSystemId); public: void NotationDecl( const CString &strName, const CString &strPublicId, const CString &strSystemId); void UnparsedEntityDecl( const CString &strName, const CString &strPublicId, const CString &strSystemId, const CString &strNotationName); public: void SetDocumentLocator(const XLocator &pLocator); void StartDocument(); void EndDocument(); void StartPrefixMapping( const CString &strPrefix, const CString &strUri); void EndPrefixMapping(const CString &strPrefix); void StartElement( const CString &strUri, const CString &strLocalName, const CString &strQName, const XAttributes &pAtts); void EndElement( const CString &strUri, const CString &strLocalName, const CString &strQName); void Characters(const WCHAR *pCh, int nLength); void IgnorableWhitespace(const WCHAR *pCh, int nLength); void ProcessingInstruction( const CString &strTarget, const CString &strData); void SkippedEntity(const CString &strName); public: void Warning(CSaxParseException *pException); void Error(CSaxParseException *pException); void FatalError(CSaxParseException *pException); };
The base class for deriving XML filters.
This class is designed to sit between an
CXmlReader
and the client application's event handlers. By default, it
does nothing but pass requests up to the reader and events
on to the handlers unmodified, but subclasses can override
specific methods to modify the event stream or the configuration
requests as they pass through.
CAttributes, CContentHandler, CDtdHandler, CEntityResolver, CErrorHandler, CInputSource, CLocator, CSaxParseException, CXmlReader
Constructor/Destructor Summary | |
CXmlFilterImpl
();
����������Constructs the empty XML filter, with no parent. |
|
CXmlFilterImpl
(const XXmlReader &pParent);
����������Constructs the XML filter with the specified parent. |
|
~CXmlFilterImpl
();
����������Destroys the XML filter. |
Function Summary | |
void
|
SetParent
(const XXmlReader &pParent);
����������Sets the parent reader. |
XXmlReader
|
GetParent
();
����������Gets the parent reader. |
void
|
SetFeature
(const CString &strName, bool bValue);
����������Sets the state of a feature. |
bool
|
GetFeature
(const CString &strName);
����������Looks up the state of a feature. |
void
|
SetProperty
(const CString &strName, CInterface *pValue);
����������Sets the value of a property. |
CInterface�*
|
GetProperty
(const CString &strName);
����������Looks up the value of a property. |
void
|
SetEntityResolver
(const XEntityResolver &pResolver);
����������Sets the entity resolver. |
XEntityResolver
|
GetEntityResolver
();
����������Gets the current entity resolver. |
void
|
SetDtdHandler
(const XDtdHandler &pHandler);
����������Sets the DTD event handler. |
XDtdHandler
|
GetDtdHandler
();
����������Gets the current DTD event handler. |
void
|
SetContentHandler
(const XContentHandler &pHandler);
����������Sets the content event handler. |
XContentHandler
|
GetContentHandler
();
����������Gets the content event handler. |
void
|
SetErrorHandler
(const XErrorHandler &pHandler);
����������Sets the error event handler. |
XErrorHandler
|
GetErrorHandler
();
����������Gets the current error event handler. |
void
|
Parse
(const XInputSource &pInput);
����������Parses a docment. |
void
|
Parse
(const CString &strSystemId);
����������Parses a document. |
bool
|
GetNamespaces
();
����������Tests whether content events generated by this filter provide namespace information. |
void
|
SetInputSource
(const XInputSource &pInput);
����������Sets the input source. |
XInputSource
|
GetInputSource
();
����������Gets the current input source. |
void
|
Start
();
����������Starts the XML stream implemented by this filter. |
XInputSource
|
ResolveEntity
(const CString &strPublicId, const CString &strSystemId);
����������Filters an external entity resolution. |
void
|
NotationDecl
(const CString &strName, const CString &strPublicId, const CString &strSystemId);
����������Filters a notation declaration event. |
void
|
UnparsedEntityDecl
(const CString &strName, const CString &strPublicId, const CString &strSystemId, const CString &strNotationName);
����������Filters an unparsed entity declaration event. |
void
|
SetDocumentLocator
(const XLocator &pLocator);
����������Filters a new document locator event. |
void
|
StartDocument
();
����������Filters a start document event. |
void
|
EndDocument
();
����������Filters an end document event. |
void
|
StartPrefixMapping
(const CString &strPrefix, const CString &strUri);
����������Filters a start namespace prefix mapping event. |
void
|
EndPrefixMapping
(const CString &strPrefix);
����������Filters an end namespace prefix mapping event. |
void
|
StartElement
(const CString &strUri, const CString &strLocalName, const CString &strQName, const XAttributes &pAtts);
����������Filters a start element event. |
void
|
EndElement
(const CString &strUri, const CString &strLocalName, const CString &strQName);
����������Filters an end element event. |
void
|
Characters
(const WCHAR *pCh, int nLength);
����������Filters a character data event. |
void
|
IgnorableWhitespace
(const WCHAR *pCh, int nLength);
����������Filters an ignorable whitespace event. |
void
|
ProcessingInstruction
(const CString &strTarget, const CString &strData);
����������Filters a processing instruction event. |
void
|
SkippedEntity
(const CString &strName);
����������Filters a skipped entity event. |
void
|
Warning
(CSaxParseException *pException);
����������Filters a warning event. |
void
|
Error
(CSaxParseException *pException);
����������Filters an error event. |
void
|
FatalError
(CSaxParseException *pException);
����������Filters a fatal error event. |
Constructor/Destructor Detail |
CXmlFilterImpl();
Constructs the empty XML filter, with no parent.
This filter will have no parent: you must assign a parent
before you start a parse or do any configuration with
SetFeature
or
SetProperty
.
CXmlFilterImpl(const XXmlReader &pParent);
Constructs the XML filter with the specified parent.
pParent
- the parent XML reader~CXmlFilterImpl();
Destroys the XML filter.
Function Detail |
void SetParent(const XXmlReader &pParent);
Sets the parent reader.
This is the XML reader from which this filter will obtain its events and to which it will pass its configuration requests. The parent may itself be another filter.
If there is no parent reader set, any attempt to parse or to set or get a feature or property will fail.
pParent
- the parent XML readerXXmlReader GetParent();
Gets the parent reader.
NULL
if none is setvoid SetFeature(const CString &strName, bool bValue);
Sets the state of a feature.
This will always fail if the parent is
NULL
.
strName
- the feature namebValue
- the requested feature statebool GetFeature(const CString &strName);
Looks up the state of a feature.
This will always fail if the parent is
NULL
.
strName
- the feature namevoid SetProperty( const CString &strName, CInterface *pValue);
Sets the value of a property.
This will always fail if the parent is
NULL
.
strName
- the property namepValue
- the requested property valueCInterface *GetProperty(const CString &strName);
Looks up the value of a property.
strName
- the property namevoid SetEntityResolver(const XEntityResolver &pResolver);
Sets the entity resolver.
pResolver
- the new entity resolverXEntityResolver GetEntityResolver();
Gets the current entity resolver.
NULL
if none was setvoid SetDtdHandler(const XDtdHandler &pHandler);
Sets the DTD event handler.
pHandler
- the new DTD handlerXDtdHandler GetDtdHandler();
Gets the current DTD event handler.
NULL
if none was setvoid SetContentHandler(const XContentHandler &pHandler);
Sets the content event handler.
pHandler
- the new content handlerXContentHandler GetContentHandler();
Gets the content event handler.
NULL
if none was setvoid SetErrorHandler(const XErrorHandler &pHandler);
Sets the error event handler.
pHandler
- the new error handlerXErrorHandler GetErrorHandler();
Gets the current error event handler.
NULL
if none was setvoid Parse(const XInputSource &pInput);
Parses a docment.
pInput
- the input source for
the document entityvoid Parse(const CString &strSystemId);
Parses a document.
strSystemId
- the system identifier as a fully-qualified URIbool GetNamespaces();
Tests whether content events generated by this filter provide namespace information.
true
if content events
generated by this filter provide namespace information;
false
otherwisevoid SetInputSource(const XInputSource &pInput);
Sets the input source.
This method is useful when the XML stream implemented
by this filter is started
using the
CXmlStream::Start
method.
pInput
- the input sourceXInputSource GetInputSource();
Gets the current input source.
NULL
if none has been registeredvoid Start();
Starts the XML stream implemented by this filter.
XInputSource ResolveEntity( const CString &strPublicId, const CString &strSystemId);
Filters an external entity resolution.
strPublicId
- the entity's public identifier,
or the empty stringstrSystemId
- the entity's system identifiervoid NotationDecl( const CString &strName, const CString &strPublicId, const CString &strSystemId);
Filters a notation declaration event.
strName
- the notation namestrPublicId
- the notation's public identifier,
or the empty stringstrSystemId
- the notation's system identifier,
or the empty stringvoid UnparsedEntityDecl( const CString &strName, const CString &strPublicId, const CString &strSystemId, const CString &strNotationName);
Filters an unparsed entity declaration event.
strName
- the entity namestrPublicId
- the entity's public identifier,
or the empty stringstrSystemId
- the entity's system identifier,
or the empty stringtstrNotationName
- the name of the associated notationvoid SetDocumentLocator(const XLocator &pLocator);
Filters a new document locator event.
pLocator
- the document locatorvoid StartDocument();
Filters a start document event.
void EndDocument();
Filters an end document event.
void StartPrefixMapping( const CString &strPrefix, const CString &strUri);
Filters a start namespace prefix mapping event.
strPrefix
- the namespace prefixstrUri
- the namespace URIvoid EndPrefixMapping(const CString &strPrefix);
Filters an end namespace prefix mapping event.
strPrefix
- the namespace prefixvoid StartElement( const CString &strUri, const CString &strLocalName, const CString &strQName, const XAttributes &pAtts);
Filters a start element event.
strUri
- the element's namespace URI, or the empty stringstrLocalName
- the element's local name, or the empty stringstrQName
- the element's qualified (prefixed) name,
or the empty stringpAtts
- the element's attributesvoid EndElement( const CString &strUri, const CString &strLocalName, const CString &strQName);
Filters an end element event.
strUri
- the element's namespace URI, or the empty stringstrLocalName
- the element's local name, or the empty stringstrQName
- the element's qualified (prefixed) name,
or the empty stringvoid Characters(const WCHAR *pCh, int nLength);
Filters a character data event.
pCh
- the array of charactersnLength
- the number of characters to use from the arrayvoid IgnorableWhitespace(const WCHAR *pCh, int nLength);
Filters an ignorable whitespace event.
pCh
- the array of charactersnLength
- the number of characters to use from the arrayvoid ProcessingInstruction( const CString &strTarget, const CString &strData);
Filters a processing instruction event.
strTarget
- the procession instruction targetstrData
- the processing instruction datavoid SkippedEntity(const CString &strName);
Filters a skipped entity event.
strName
- the name of the skipped entityvoid Warning(CSaxParseException *pException);
Filters a warning event.
pException
- the exception representing the warningvoid Error(CSaxParseException *pException);
Filters an error event.
pException
- the exception representing the errorvoid FatalError(CSaxParseException *pException);
Filters a fatal error event.
pException
- the exception representing the error
|
Unicorn XML Toolkit Version 1.00.00 |
|||||||||
� PREV CLASS ��NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |