#include <DOMWriter.hpp>
Public Member Functions | |
Functions introduced in DOM Level 3 | |
virtual bool | canSetFeature (const XMLCh *const featName, bool state) const=0 |
Query whether setting a feature to a specific value is supported. | |
virtual void | setFeature (const XMLCh *const featName, bool state)=0 |
Set the state of a feature. | |
virtual bool | getFeature (const XMLCh *const featName) const=0 |
Look up the value of a feature. | |
virtual void | setEncoding (const XMLCh *const encoding)=0 |
The character encoding in which the output will be written. | |
virtual void | setNewLine (const XMLCh *const newLine)=0 |
The end-of-line sequence of characters to be used in the XML being written out. | |
virtual void | setErrorHandler (DOMErrorHandler *errorHandler)=0 |
The error handler that will receive error notifications during serialization. | |
virtual void | setFilter (DOMWriterFilter *filter)=0 |
When the application provides a filter, the serializer will call out to the filter before serializing each Node. | |
virtual const XMLCh * | getEncoding () const=0 |
Return the character encoding in which the output will be written. | |
virtual const XMLCh * | getNewLine () const=0 |
Return the end-of-line sequence of characters to be used in the XML being written out. | |
virtual DOMErrorHandler * | getErrorHandler () const=0 |
Return the error handler that will receive error notifications during serialization. | |
virtual DOMWriterFilter * | getFilter () const=0 |
Return the WriterFilter used. | |
virtual bool | writeNode (XMLFormatTarget *const destination, const DOMNode &nodeToWrite)=0 |
Write out the specified node as described above in the description of DOMWriter . | |
virtual XMLCh * | writeToString (const DOMNode &nodeToWrite)=0 |
Serialize the specified node as described above in the description of DOMWriter . | |
Non-standard Extension | |
virtual void | release ()=0 |
Called to indicate that this Writer is no longer in use and that the implementation may relinquish any resources associated with it. |
xercesc::DOMWriter::DOMWriter | ( | ) | [inline, protected] |
virtual xercesc::DOMWriter::~DOMWriter | ( | ) | [inline, virtual] |
Destructor.
xercesc::DOMWriter::DOMWriter | ( | ) | [inline, protected] |
virtual xercesc::DOMWriter::~DOMWriter | ( | ) | [inline, virtual] |
Destructor.
virtual bool xercesc::DOMWriter::canSetFeature | ( | const XMLCh *const | featName, | |
bool | state | |||
) | const [pure virtual] |
Query whether setting a feature to a specific value is supported.
The feature name has the same form as a DOM hasFeature string.
"Experimental - subject to change"
featName | The feature name, which is a DOM has-feature style string. | |
state | The requested state of the feature (true or false ). |
true
if the feature could be successfully set to the specified value, or false
if the feature is not recognized or the requested value is not supported. The value of the feature itself is not changed. virtual void xercesc::DOMWriter::setFeature | ( | const XMLCh *const | featName, | |
bool | state | |||
) | [pure virtual] |
Set the state of a feature.
The feature name has the same form as a DOM hasFeature string.
It is possible for a DOMWriter
to recognize a feature name but to be unable to set its value.
"Experimental - subject to change"
featName | The feature name. | |
state | The requested state of the feature (true or false ). |
DOMException | Raise a NOT_SUPPORTED_ERR exception when the DOMWriter recognizes the feature name but cannot set the requested value. Raise a NOT_FOUND_ERR When the DOMWriter does not recognize the feature name. |
virtual bool xercesc::DOMWriter::getFeature | ( | const XMLCh *const | featName | ) | const [pure virtual] |
Look up the value of a feature.
The feature name has the same form as a DOM hasFeature string
featName | The feature name, which is a string with DOM has-feature syntax. |
true
or false
). DOMException | Raise a NOT_FOUND_ERR When the DOMWriter does not recognize the feature name. |
"Experimental - subject to change"
virtual void xercesc::DOMWriter::setEncoding | ( | const XMLCh *const | encoding | ) | [pure virtual] |
The character encoding in which the output will be written.
The encoding to use when writing is determined as follows: If the encoding attribute has been set, that value will be used.If the encoding attribute is null
or empty, but the item to be written includes an encoding declaration, that value will be used.If neither of the above provides an encoding name, a default encoding of "UTF-8" will be used.
The default value is null
.
"Experimental - subject to change"
encoding | The character encoding in which the output will be written. |
virtual void xercesc::DOMWriter::setNewLine | ( | const XMLCh *const | newLine | ) | [pure virtual] |
The end-of-line sequence of characters to be used in the XML being written out.
The only permitted values are these:
null
null
."Experimental - subject to change"
newLine | The end-of-line sequence of characters to be used. |
virtual void xercesc::DOMWriter::setErrorHandler | ( | DOMErrorHandler * | errorHandler | ) | [pure virtual] |
The error handler that will receive error notifications during serialization.
The node where the error occured is passed to this error handler, any modification to nodes from within an error callback should be avoided since this will result in undefined, implementation dependent behavior.
"Experimental - subject to change"
errorHandler | The error handler to be used. |
virtual void xercesc::DOMWriter::setFilter | ( | DOMWriterFilter * | filter | ) | [pure virtual] |
When the application provides a filter, the serializer will call out to the filter before serializing each Node.
Attribute nodes are never passed to the filter. The filter implementation can choose to remove the node from the stream or to terminate the serialization early.
"Experimental - subject to change"
filter | The writer filter to be used. |
virtual const XMLCh* xercesc::DOMWriter::getEncoding | ( | ) | const [pure virtual] |
Return the character encoding in which the output will be written.
"Experimental - subject to change"
virtual const XMLCh* xercesc::DOMWriter::getNewLine | ( | ) | const [pure virtual] |
Return the end-of-line sequence of characters to be used in the XML being written out.
"Experimental - subject to change"
virtual DOMErrorHandler* xercesc::DOMWriter::getErrorHandler | ( | ) | const [pure virtual] |
Return the error handler that will receive error notifications during serialization.
"Experimental - subject to change"
virtual DOMWriterFilter* xercesc::DOMWriter::getFilter | ( | ) | const [pure virtual] |
Return the WriterFilter used.
"Experimental - subject to change"
virtual bool xercesc::DOMWriter::writeNode | ( | XMLFormatTarget *const | destination, | |
const DOMNode & | nodeToWrite | |||
) | [pure virtual] |
Write out the specified node as described above in the description of DOMWriter
.
Writing a Document or Entity node produces a serialized form that is well formed XML. Writing other node types produces a fragment of text in a form that is not fully defined by this document, but that should be useful to a human for debugging or diagnostic purposes.
"Experimental - subject to change"
destination | The destination for the data to be written. | |
nodeToWrite | The Document or Entity node to be written. For other node types, something sensible should be written, but the exact serialized form is not specified. |
true
if node
was successfully serialized and false
in case a failure occured and the failure wasn't canceled by the error handler. virtual XMLCh* xercesc::DOMWriter::writeToString | ( | const DOMNode & | nodeToWrite | ) | [pure virtual] |
Serialize the specified node as described above in the description of DOMWriter
.
The result of serializing the node is returned as a string. Writing a Document or Entity node produces a serialized form that is well formed XML. Writing other node types produces a fragment of text in a form that is not fully defined by this document, but that should be useful to a human for debugging or diagnostic purposes.
"Experimental - subject to change"
nodeToWrite | The node to be written. |
null
in case a failure occured and the failure wasn't canceled by the error handler. The returned string is always in UTF-16. The encoding information available in DOMWriter is ignored in writeToString(). virtual void xercesc::DOMWriter::release | ( | ) | [pure virtual] |
Called to indicate that this Writer is no longer in use and that the implementation may relinquish any resources associated with it.
Access to a released object will lead to unexpected result.