|
Unicorn XML Toolkit Version 1.50.00 |
|||||||||
� PREV CLASS �� NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |
class CDomWriter: public SaxSxp::CContentHandlerAdapter { public: CDomWriter( CToolkitBase *pToolkitBase, Dom::INode *pNode=NULL); ~CDomWriter(); public: void StartDocument(); void EndDocument(); public: void SetNode(Dom::INode *pNode); Dom::XNode GetNode(); void SetNamespaces(bool bNamespaces); bool GetNamespaces(); void PreserveSpace( const WCHAR *pszNamespaceUri=NULL, const WCHAR *pszLocalName=NULL); void StripSpace( const WCHAR *pszNamespaceUri=NULL, const WCHAR *pszLocalName=NULL); }; typedef XInterface<CDomWriter> XDomWriter;
The DOM writer.
This is the subclass of SAX XML content handler, which receives the stream of SAX content events, converting them into a DOM/XDM document fragment, which it builds under specified parent node.
Both DOM and XDM document models are supported. (See
Dom
for a general discussion concerning DOM
and XDM document models).
This class effectively implements an adapter from SAX to DOM/XDM.
Any DOM/XDM node, which is allowed to have children may serve as a target sub-tree 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.
Technically, this class subclasses the internal toolkit
class
SaxSxp::CContentHandlerAdapter
, which is in
turn a subclass of
Sax::CContentHandler
and
implements all standard methods of SAX content handlers.
This class supports the whitespace stripping functionality. The application programmer may specify names of elements, for which the whitespaces (that is, text nodes containing whitespace characters only) must be removed (stripped) from the result tree. The whitespace stripping technique is similar to one described in XSL Transformations (XSLT) Version 1.0. .
CToolkitBase, Dom::INode
Constructor/Destructor Summary | |
CDomWriter
(CToolkitBase *pToolkitBase, Dom::INode *pNode=NULL);
����������Constructs the DOM writer. |
|
~CDomWriter
();
����������Destroys the DOM writer. |
Function Summary | |
void
|
StartDocument
();
����������Receives notification of the beginning of a document. |
void
|
EndDocument
();
����������Receives notification of the end of a document. |
void
|
SetNode
(Dom::INode *pNode);
����������Sets the node serving as the parent for a sub-tree to be built. |
Dom::XNode
|
GetNode
();
����������Returns a parent node of a sub-tree to be built. |
void
|
SetNamespaces
(bool bNamespaces);
����������Specifies whether the source content 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
|
PreserveSpace
(const WCHAR *pszNamespaceUri=NULL, const WCHAR *pszLocalName=NULL);
����������Requests preserving whitespaces on elements with the specified namespace URI and local name. |
void
|
StripSpace
(const WCHAR *pszNamespaceUri=NULL, const WCHAR *pszLocalName=NULL);
����������Requests stripping whitespaces on elements with the specified namespace URI and local name. |
Constructor/Destructor Detail |
CDomWriter( CToolkitBase *pToolkitBase, Dom::INode *pNode=NULL);
Constructs the DOM writer.
pToolkitBase
- the master toolkit basepNode
- the node serving as the parent for
a sub-tree to be built. If this parameter is set to
NULL
at construction time,
the actual node must be specified using the
SetNode
method before starting the source stream of SAX content events.~CDomWriter();
Destroys the DOM writer.
Function Detail |
void StartDocument();
Receives notification of the beginning of a document.
void EndDocument();
Receives notification of the end of a document.
void SetNode(Dom::INode *pNode);
Sets the node serving as the parent for a sub-tree to be built.
pNode
- the node serving as the parent for
a sub-tree to be builtDom::XNode GetNode();
Returns a parent node of a sub-tree to be built.
void SetNamespaces(bool bNamespaces);
Specifies whether the source content 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 PreserveSpace( const WCHAR *pszNamespaceUri=NULL, const WCHAR *pszLocalName=NULL);
Requests preserving whitespaces on elements with the specified namespace URI and local name.
If the namespace URI is set to
NULL
,
whitespaces are preserved on all elements. If the local name
is set to
NULL
, whitespaces are preserved on all
elements with the given namespace URI.
pszNamespaceUri
- the namespace URIpszLocalName
- the local namevoid StripSpace( const WCHAR *pszNamespaceUri=NULL, const WCHAR *pszLocalName=NULL);
Requests stripping whitespaces on elements with the specified namespace URI and local name.
If the namespace URI is set to
NULL
,
whitespaces are stripped on all elements. If the local name
is set to
NULL
, whitespaces are stripped on all
elements with the given namespace URI.
pszNamespaceUri
- the namespace URIpszLocalName
- the local name
|
Unicorn XML Toolkit Version 1.50.00 |
|||||||||
� PREV CLASS �� NEXT CLASS | FRAMES��NO FRAMES | |||||||||
SUMMARY: � CONSTR �|� FUNCTION �|�DATA | DETAIL: � CONSTR �|� FUNCTION �|�DATA |