|
Unicorn XML Toolkit Version 1.00.00 |
|||||||||
� PREV CLASS �� NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |
class COutputHandler: public CInterface { public: enum { disableOutputEscaping = 0x01 }; public: COutputHandler(); virtual ~COutputHandler(); public: virtual void SetOptions( const XOutputOptions &pOutputOptions) = 0; virtual void StartDocument() = 0; virtual void EndDocument() = 0; virtual void StartElement( const CString &strName, const CString &strNamespaceUri) = 0; virtual void EndElement() = 0; virtual void StartAttribute( const CString &strName, const CString &strNamespaceUri) = 0; virtual void EndAttribute() = 0; virtual void StartNamespace(const CString &strName) = 0; virtual void EndNamespace() = 0; virtual void CharacterData( const WCHAR *pData, int nSize, int nOptions=0) = 0; virtual void StartComment() = 0; virtual void EndComment() = 0; virtual void StartCdataSection() = 0; virtual void EndCdataSection() = 0; virtual void EntityReference(const CString &strName) = 0; virtual void ProcessingInstruction( const CString &strTarget, const CString &strData) = 0; };
The abstract interface to the XSLT output engine.
The output engine receives the result document (or the result
tree fragment) represented as a stream of events.
The
COutputHandler
class provides
the set of event processing functions; the XSLT engine
calls these functions in order to pass events to the output engine.
The format of events
is very similar to that supported by SXP (Simple XSL Parser
API, see
Sxp
namespace for details); the main
difference is that events
StartElement
and
StartAttribute
supply the namespace URI as
an additional parameter, and all namespace declarations
are reported using the separate pair of events
StartNamespace
and
EndNamespace
.
At least one derived class must be supplied to provide
implementation of this interface. The default implementation is
provided via the
CBasicOutputHandler
class,
which implements all standard XSLT output
methods.
COutputOptions
Constructor/Destructor Summary | |
COutputHandler
();
����������Constructs the output handler. |
|
~COutputHandler
();
����������Destroys the output handler. |
Function Summary | |
void
|
SetOptions
(const XOutputOptions &pOutputOptions);
����������Sets output options for this output handler. |
void
|
StartDocument
();
����������Receives notification of the beginning of a document or a result tree fragment. |
void
|
EndDocument
();
����������Receives notification of the end of a document or a result tree fragment. |
void
|
StartElement
(const CString &strName, const CString &strNamespaceUri);
����������Receives notification of the beginning of an element. |
void
|
EndElement
();
����������Receives notification of the end of an element. |
void
|
StartAttribute
(const CString &strName, const CString &strNamespaceUri);
����������Receives notification of the beginning of an attribute. |
void
|
EndAttribute
();
����������Receives notification of the end of an attribute. |
void
|
StartNamespace
(const CString &strName);
����������Receives notification of the beginning of a namespace declaration. |
void
|
EndNamespace
();
����������Receives notification of the end of a namespace declaration. |
void
|
CharacterData
(const WCHAR *pData, int nSize, int nOptions=0);
����������Receives notification of character data. |
void
|
StartComment
();
����������Receives notification of the beginning of a comment. |
void
|
EndComment
();
����������Receives notification of the end of a comment. |
void
|
StartCdataSection
();
����������Receives notification of the beginning of a CDATA section. |
void
|
EndCdataSection
();
����������Receives notification of the end of a CDATA section. |
void
|
EntityReference
(const CString &strName);
����������Receives notification of an entity reference. |
void
|
ProcessingInstruction
(const CString &strTarget, const CString &strData);
����������Receives notification of a processing instruction. |
Constructor/Destructor Detail |
COutputHandler();
Constructs the output handler.
virtual ~COutputHandler();
Destroys the output handler.
Function Detail |
virtual void SetOptions( const XOutputOptions &pOutputOptions) = 0;
Sets output options for this output handler.
pOutputOptions
- the output optionsvirtual void StartDocument() = 0;
Receives notification of the beginning of a document or a result tree fragment.
This function is invoked only once per document, before any other event processing functions in this class.
This function is invoked even if the event stream represents a result tree fragment rather than a document.
virtual void EndDocument() = 0;
Receives notification of the end of a document or a result tree fragment.
This function is invoked only once per document, after any other event processing functions in this class.
This function is invoked even if the event stream represents a result tree fragment rather than a document.
virtual void StartElement( const CString &strName, const CString &strNamespaceUri) = 0;
Receives notification of the beginning of an element.
Both qualified name and namespace URI must be specified. The specified namespace URI (even if empty) is mandatory; it supersedes the namespace implicitly defined by the prefix of the specified qualified name.
This function is invoked at the beginning
of every element in the result document; there will be
a corresponding
EndElement
event for every
StartElement
event (even when the element is empty).
All of the namespaces in the scope on the element,
followed by all of the element's attributes, followed by
all of the element's content will be reported, in order,
before the coresponding
EndElement
event.
strName
- the qualified (prefixed) namestrNamespaceUri
- the namespace URI;
the empty string if the element has no namespace URIvirtual void EndElement() = 0;
Receives notification of the end of an element.
This function is invoked at the end of every
element in the result document; there will be a corresponding
StartElement
event for every
EndElement
event (even when the element is empty).
virtual void StartAttribute( const CString &strName, const CString &strNamespaceUri) = 0;
Receives notification of the beginning of an attribute.
Both qualified name and namespace URI must be specified. The specified namespace URI (even if empty) is mandatory; it supersedes the namespace implicitly defined by the prefix of the specified qualified name.
This function is invoked at the beginning
of every attribute declaration in the result document; there will be
a corresponding
EndAttribute
event for every
StartAttribute
event.
The attribute value will be reported as one or more
CharacterData
events,
before the coresponding
EndAttribute
event.
This function is never invoked to report
attributes corresponding to namespace declarations
(that is, having names started with
"xmlns"
).
strName
- the qualified (prefixed) namestrNamespaceUri
- the namespace URI;
the empty string if the element has no namespace URIvirtual void EndAttribute() = 0;
Receives notification of the end of an attribute.
This function is invoked at the end of every
attribute declaration in the result document; there will be a corresponding
StartAttribute
event for every
EndAttribute
event.
virtual void StartNamespace(const CString &strName) = 0;
Receives notification of the beginning of a namespace declaration.
Notifications must be generated for all namespace declarations in scope on every element in the result document (even for namespaces that are actually declared on the element's ancestor).
This function is invoked at the beginning
of every namespace declaration; there will be
a corresponding
EndNamespace
event for every
StartNamespace
event.
The namespace URI will be reported as one or more
CharacterData
events,
before the coresponding
EndNamespace
event.
strName
- the namespace prefixvirtual void EndNamespace() = 0;
Receives notification of the end of a namespace declaration.
This function is invoked at the end of every
namespace declaration; there will be a corresponding
StartNamespace
event for every
EndNamespace
event.
virtual void CharacterData( const WCHAR *pData, int nSize, int nOptions=0) = 0;
Receives notification of character data.
This function is invoked to report each chunk of character data, each chunk of the content of every comment, each chunk of every attribute value, and each chunk of the namespace URI in every namespace declaration.
Applications may supply all contiguous character data in a single chunk, or they may split it into several chunks.
The output options are represented by the set
of bit flags. The only allowed bit flag is
COutputHandler::disableOutputEscaping
.
pData
- the array of charactersnSize
- the number of characters
to read from the arraynOptions
- the set of bit flags
indicating output optionsvirtual void StartComment() = 0;
Receives notification of the beginning of a comment.
This function is invoked at the beginning
of every comment in the result document; there will be
a corresponding
EndComment
event for every
StartComment
event.
The contents of the comment will be reported as one or more
CharacterData
events,
before the coresponding
EndComment
event.
virtual void EndComment() = 0;
Receives notification of the end of a comment.
This function is invoked at the end of every
comment in the result document; there will be a corresponding
StartComment
event for every
EndComment
event.
virtual void StartCdataSection() = 0;
Receives notification of the beginning of a CDATA section.
This function is invoked at the beginning
of every CDATA section in the result document; there will be
a corresponding
EndCdataSection
event for every
StartCdataSection
event.
The contents of the CDATA section will be reported as one or more
CharacterData
events,
before the coresponding
EndCdataSection
event.
In the current release of the toolkit, this function is never called by the XSLT engine. It is reserved for the future.
virtual void EndCdataSection() = 0;
Receives notification of the end of a CDATA section.
This function is invoked at the end of every
CDATA section in the result document; there will be a corresponding
StartCdataSection
event for every
EndCdataSection
event.
In the current release of the toolkit, this function is never called by the XSLT engine. It is reserved for the future.
virtual void EntityReference(const CString &strName) = 0;
Receives notification of an entity reference.
This function is invoked for each entity skipped.
In the current release of the toolkit, this function is never called by the XSLT engine. It is reserved for the future.
strName
- the entity namevirtual void ProcessingInstruction( const CString &strTarget, const CString &strData) = 0;
Receives notification of a processing instruction.
This function is invoked once for each processing instruction in the result document.
strTarget
- the processing instruction targetstrData
- the processing instruction data;
the empty string if none was supplied
|
Unicorn XML Toolkit Version 1.00.00 |
|||||||||
� PREV CLASS �� NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |