|
Unicorn XML Toolkit Version 1.00.00 |
|||||||||
� PREV CLASS ��NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |
class CWriter: public Sax::CContentHandler { public: CWriter(const Dom::XNode &pNode); ~CWriter(); public: void SetNode(const Dom::XNode &pNode); Dom::XNode GetNode(); void SetNamespaces(bool bNamespaces); bool GetNamespaces(); public: void SetDocumentLocator(const Sax::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 Sax::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); };
The DOM writer.
This class provides implementation of SAX content handler that consumes a sequence of SAX content events and builds a subtree rooted at the specified DOM/XDM node (called target subtree root).
Any DOM/XDM node which is allowed to have children may serve as a target subtree root. In particular, if an empty document node is specified as the root, the writer will build the entire document tree based on the content of the source events.
For each particular DOM writer, the application programmer can specify, whether source events must provide namespace information, obtained as the result of SAX namespace processing.
Dom::INode, Sax::CAttributes, Sax::CLocator
Constructor/Destructor Summary | |
CWriter
(const Dom::XNode &pNode);
����������Constructs the writer. |
|
~CWriter
();
����������Destroys the writer. |
Function Summary | |
void
|
SetNode
(const Dom::XNode &pNode);
����������Specifies the target subtree root. |
Dom::XNode
|
GetNode
();
����������Returns the target subtree root. |
void
|
SetNamespaces
(bool bNamespaces);
����������Specifies whether the source events must provide namespace information obtained as the result of SAX namespace processing. |
bool
|
GetNamespaces
();
����������Tests whether the source events must provide namespace information obtained as the result of SAX namespace processing. |
void
|
SetDocumentLocator
(const Sax::XLocator &pLocator);
����������Receives an object for locating the origin of SAX content events. |
void
|
StartDocument
();
����������Receives notification of the beginning of a document. |
void
|
EndDocument
();
����������Receives notification of the end of a document. |
void
|
StartPrefixMapping
(const CString &strPrefix, const CString &strUri);
����������Begins the scope of a namespace prefix-URI mapping. |
void
|
EndPrefixMapping
(const CString &strPrefix);
����������Ends the scope of a namespace prefix-URI mapping. |
void
|
StartElement
(const CString &strUri, const CString &strLocalName, const CString &strQName, const Sax::XAttributes &pAtts);
����������Receives notification of the beginning of an element. |
void
|
EndElement
(const CString &strUri, const CString &strLocalName, const CString &strQName);
����������Receives notification of the end of an element. |
void
|
Characters
(const WCHAR *pCh, int nLength);
����������Receives notification of character data. |
void
|
IgnorableWhitespace
(const WCHAR *pCh, int nLength);
����������Receives notification of ignorable whitespace in element content. |
void
|
ProcessingInstruction
(const CString &strTarget, const CString &strData);
����������Receives notification of a processing instruction. |
void
|
SkippedEntity
(const CString &strName);
����������Receives notification of a skipped entity. |
Constructor/Destructor Detail |
CWriter(const Dom::XNode &pNode);
Constructs the writer.
pNode
- the node serving as the target
subtree root~CWriter();
Destroys the writer.
Function Detail |
void SetNode(const Dom::XNode &pNode);
Specifies the target subtree root.
pNode
- the node serving as the target
subtree rootDom::XNode GetNode();
Returns the target subtree root.
NULL
if none was specifiedvoid SetNamespaces(bool bNamespaces);
Specifies whether the source events must provide namespace information obtained as the result of SAX namespace processing.
bNamespaces
-
true
if namespace
information is required in the source;
false
otherwisebool GetNamespaces();
Tests whether the source events must provide namespace information obtained as the result of SAX namespace processing.
true
if namespace
information is required in the source;
false
otherwisevoid SetDocumentLocator(const Sax::XLocator &pLocator);
Receives an object for locating the origin of SAX content events.
pLocator
- an object that can return the location of
any SAX content eventvoid StartDocument();
Receives notification of the beginning of a document.
void EndDocument();
Receives notification of the end of a document.
void StartPrefixMapping( const CString &strPrefix, const CString &strUri);
Begins the scope of a namespace prefix-URI mapping.
strPrefix
- the namespace prefix being declaredstrUri
- the namespace URI the prefix is mapped tovoid EndPrefixMapping(const CString &strPrefix);
Ends the scope of a namespace prefix-URI mapping.
strPrefix
- the prefix that was being mappedvoid StartElement( const CString &strUri, const CString &strLocalName, const CString &strQName, const Sax::XAttributes &pAtts);
Receives notification of the beginning of an element.
strUri
- the namespace URI, or the empty string if the
element has no namespace URI or if namespace
processing is not being performedstrLocalName
- the local name (without prefix), or the
empty string if namespace processing is not being
performedstrQName
- the qualified name (with prefix), or the
empty string if qualified names are not availablepAtts
- the list of
attributes attached to the element. If
there are no attributes, it shall be an emptyvoid EndElement( const CString &strUri, const CString &strLocalName, const CString &strQName);
Receives notification of the end of an element.
strUri
- the namespace URI, or the empty string if the
element has no namespace URI or if namespace
processing is not being performedstrLocalName
- the local name (without prefix), or the
empty string if namespace processing is not being
performedstrQName
- the qualified name (with prefix), or the
empty string if qualified names are not availablevoid Characters(const WCHAR *pCh, int nLength);
Receives notification of character data.
pCh
- the array of characters
from the XML documentnLength
- the number of characters
to read from the arrayvoid IgnorableWhitespace(const WCHAR *pCh, int nLength);
Receives notification of ignorable whitespace in element content.
pCh
- the array of characters
from the XML documentnLength
- the number of characters
to read from the arrayvoid ProcessingInstruction( const CString &strTarget, const CString &strData);
Receives notification of a processing instruction.
strTarget
- the processing instruction targetstrData
- the processing instruction data,
or the empty string if none was suppliedvoid SkippedEntity(const CString &strName);
Receives notification of a skipped entity.
strName
- the name of the skipped entity
|
Unicorn XML Toolkit Version 1.00.00 |
|||||||||
� PREV CLASS ��NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |