|
Unicorn XML Toolkit Version 1.00.00 |
|||||||||
� PREV CLASS �� NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |
class IFormatter: public CInterface { public: IFormatter(); virtual ~IFormatter(); public: virtual void SetOutputHandler( IOutputHandler *pOutputHandler) = 0; virtual void SetErrorHandler( IErrorHandler *pErrorHandler) = 0; public: 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) = 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 HTML-based UFO front-end (formatter).
The formatter receives the source document represented
as a stream of events. The
IFormatter
class provides
the set of event processing functions; the application which
generates the source document must call these functions in
order to pass events to the front-end. The format of events
is very similar to that supported by SXP (Simple XML 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
(these features were introduced in order to
simplify interfacing between the toolkit's XSLT engine and
this front-end).
It is expected, that the source document is represented
using the XSL FO vocabulary. The formatter generates
HTML code as the sequence of output events. The generated
events are passed to the instance of
IOutputHandler
associated with this formatter.
The error handler represented by an instance of
IErrorHandler
class can be specified
to receive notifications of
errors and warnings which might occur while the formatter
is running.
IOutputHandler, IErrorHandler
Constructor/Destructor Summary | |
IFormatter
();
����������Constructs the formatter. |
|
~IFormatter
();
����������Destroys the formatter. |
Function Summary | |
void
|
SetOutputHandler
(IOutputHandler *pOutputHandler);
����������Specifies the output handler for receiving content or the result HTML document generated by this formatter. |
void
|
SetErrorHandler
(IErrorHandler *pErrorHandler);
����������Specifies the error handler for receiving notifications of errors and warnings. |
void
|
StartDocument
();
����������Receives notification of the beginning of a document. |
void
|
EndDocument
();
����������Receives notification of the end of a document. |
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);
����������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 |
IFormatter();
Constructs the formatter.
virtual ~IFormatter();
Destroys the formatter.
Function Detail |
virtual void SetOutputHandler( IOutputHandler *pOutputHandler) = 0;
Specifies the output handler for receiving content or the result HTML document generated by this formatter.
pOutputHandler
- the output handlervirtual void SetErrorHandler(IErrorHandler *pErrorHandler) = 0;
Specifies the error handler for receiving notifications of errors and warnings.
pErrorHandler
- the error handlervirtual void StartDocument() = 0;
Receives notification of the beginning of a document.
This function is invoked only once per document, before any other event processing functions in this class.
virtual void EndDocument() = 0;
Receives notification of the end of a document.
This function is invoked only once per document, after any other event processing functions in this class.
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 source 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 source 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 source 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 source 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 source 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) = 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.
pData
- the array of charactersnSize
- the number of characters
to read from the arrayvirtual void StartComment() = 0;
Receives notification of the beginning of a comment.
This function is invoked at the beginning
of every comment in the source 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 source 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 source 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.
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 source document; there will be a corresponding
StartCdataSection
event for every
EndCdataSection
event.
virtual void EntityReference(const CString &strName) = 0;
Receives notification of an entity reference.
This function is invoked for each entity skipped.
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 source 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 |