1 | <HTML><HEAD><SCRIPT language="JavaScript" src="../resources/script.js" type="text/javascript"></SCRIPT><TITLE>DOMWriter class Reference</TITLE><link href="XercesApi.css" rel="stylesheet" type="text/css"></HEAD><BODY alink="#ff0000" bgcolor="#ffffff" leftmargin="4" link="#0000ff" marginheight="4" marginwidth="4" text="#000000" topmargin="4" vlink="#0000aa"><TABLE border="0" cellpadding="0" cellspacing="0" width="620"><TR><TD align="left" height="60" rowspan="3" valign="top" width="135"><IMG border="0" height="60" hspace="0" src="../resources/logo.gif" vspace="0" width="135"></TD><TD align="left" colspan="4" height="5" valign="top" width="456"><IMG border="0" height="5" hspace="0" src="../resources/line.gif" vspace="0" width="456"></TD><TD align="left" height="60" rowspan="3" valign="top" width="29"><IMG border="0" height="60" hspace="0" src="../resources/right.gif" vspace="0" width="29"></TD></TR><TR><TD align="left" bgcolor="#0086b2" colspan="4" height="35" valign="top" width="456"><IMG alt="" border="0" height="35" hspace="0" src="../graphics/api-header.jpg" vspace="0" width="456"></TD></TR><TR><TD align="left" height="20" valign="top" width="168"><IMG border="0" height="20" hspace="0" src="../resources/bottom.gif" vspace="0" width="168"></TD><TD align="left" height="20" valign="top" width="96"><A href="http://xml.apache.org/" onMouseOut="rolloverOff('xml');" onMouseOver="rolloverOn('xml');" target="new"><IMG alt="http://xml.apache.org/" border="0" height="20" hspace="0" name="xml" onLoad="rolloverLoad('xml','../resources/button-xml-hi.gif','../resources/button-xml-lo.gif');" src="../resources/button-xml-lo.gif" vspace="0" width="96"></A></TD><TD align="left" height="20" valign="top" width="96"><A href="http://www.apache.org/" onMouseOut="rolloverOff('asf');" onMouseOver="rolloverOn('asf');" target="new"><IMG alt="http://www.apache.org/" border="0" height="20" hspace="0" name="asf" onLoad="rolloverLoad('asf','../resources/button-asf-hi.gif','../resources/button-asf-lo.gif');" src="../resources/button-asf-lo.gif" vspace="0" width="96"></A></TD><TD align="left" height="20" valign="top" width="96"><A href="http://www.w3.org/" onMouseOut="rolloverOff('w3c');" onMouseOver="rolloverOn('w3c');" target="new"><IMG alt="http://www.w3.org/" border="0" height="20" hspace="0" name="w3c" onLoad="rolloverLoad('w3c','../resources/button-w3c-hi.gif','../resources/button-w3c-lo.gif');" src="../resources/button-w3c-lo.gif" vspace="0" width="96"></A></TD></TR></TABLE><TABLE border="0" cellpadding="0" cellspacing="0" width="620"><TR><TD align="left" valign="top" width="120"><IMG border="0" height="14" hspace="0" src="../resources/join.gif" vspace="0" width="120"><BR>
|
---|
2 | <A href="../../index.html" onMouseOut="rolloverOff('side-ext-2');" onMouseOver="rolloverOn('side-ext-2');"><IMG alt="Home" border="0" height="12" hspace="0" name="side-ext-2" onLoad="rolloverLoad('side-ext-2','../graphics/ext-2-label-2.jpg','../graphics/ext-2-label-3.jpg');" src="../graphics/ext-2-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
3 |
|
---|
4 | <IMG border="0" height="6" hspace="0" src="../resources/separator.gif" vspace="0" width="120"><BR>
|
---|
5 |
|
---|
6 | <A href="../index.html" onMouseOut="rolloverOff('side-index');" onMouseOver="rolloverOn('side-index');"><IMG alt="Readme" border="0" height="12" hspace="0" name="side-index" onLoad="rolloverLoad('side-index','../graphics/index-label-2.jpg','../graphics/index-label-3.jpg');" src="../graphics/index-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
7 | <A href="../releases.html" onMouseOut="rolloverOff('side-releases');" onMouseOver="rolloverOn('side-releases');"><IMG alt="Release Info" border="0" height="12" hspace="0" name="side-releases" onLoad="rolloverLoad('side-releases','../graphics/releases-label-2.jpg','../graphics/releases-label-3.jpg');" src="../graphics/releases-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
8 | <IMG border="0" height="6" hspace="0" src="../resources/separator.gif" vspace="0" width="120"><BR>
|
---|
9 | <A href="../install.html" onMouseOut="rolloverOff('side-install');" onMouseOver="rolloverOn('side-install');"><IMG alt="Installation" border="0" height="12" hspace="0" name="side-install" onLoad="rolloverLoad('side-install','../graphics/install-label-2.jpg','../graphics/install-label-3.jpg');" src="../graphics/install-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
10 | <A href="http://xml.apache.org/dist/xerces-c/" onMouseOut="rolloverOff('side-ext-18');" onMouseOver="rolloverOn('side-ext-18');"><IMG alt="Download" border="0" height="12" hspace="0" name="side-ext-18" onLoad="rolloverLoad('side-ext-18','../graphics/ext-18-label-2.jpg','../graphics/ext-18-label-3.jpg');" src="../graphics/ext-18-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
11 | <A href="../build.html" onMouseOut="rolloverOff('side-build');" onMouseOver="rolloverOn('side-build');"><IMG alt="Build" border="0" height="12" hspace="0" name="side-build" onLoad="rolloverLoad('side-build','../graphics/build-label-2.jpg','../graphics/build-label-3.jpg');" src="../graphics/build-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
12 |
|
---|
13 | <IMG border="0" height="6" hspace="0" src="../resources/separator.gif" vspace="0" width="120"><BR>
|
---|
14 | <A href="../faqs.html" onMouseOut="rolloverOff('side-faqs');" onMouseOver="rolloverOn('side-faqs');"><IMG alt="FAQs" border="0" height="12" hspace="0" name="side-faqs" onLoad="rolloverLoad('side-faqs','../graphics/faqs-label-2.jpg','../graphics/faqs-label-3.jpg');" src="../graphics/faqs-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
15 | <A href="../samples.html" onMouseOut="rolloverOff('side-samples');" onMouseOver="rolloverOn('side-samples');"><IMG alt="Samples" border="0" height="12" hspace="0" name="side-samples" onLoad="rolloverLoad('side-samples','../graphics/samples-label-2.jpg','../graphics/samples-label-3.jpg');" src="../graphics/samples-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
16 | <A href="../api.html" onMouseOut="rolloverOff('side-api');" onMouseOver="rolloverOn('side-api');"><IMG alt="API Docs" border="0" height="12" hspace="0" name="side-api" onLoad="rolloverLoad('side-api','../graphics/api-label-2.jpg','../graphics/api-label-3.jpg');" src="../graphics/api-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
17 |
|
---|
18 | <IMG border="0" height="6" hspace="0" src="../resources/separator.gif" vspace="0" width="120"><BR>
|
---|
19 | <A href="../ApacheDOMC++Binding.html" onMouseOut="rolloverOff('side-ext-68');" onMouseOver="rolloverOn('side-ext-68');"><IMG alt="DOM C++ Binding" border="0" height="12" hspace="0" name="side-ext-68" onLoad="rolloverLoad('side-ext-68','../graphics/ext-68-label-2.jpg','../graphics/ext-68-label-3.jpg');" src="../graphics/ext-68-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
20 |
|
---|
21 | <A href="../program.html" onMouseOut="rolloverOff('side-program');" onMouseOver="rolloverOn('side-program');"><IMG alt="Programming" border="0" height="12" hspace="0" name="side-program" onLoad="rolloverLoad('side-program','../graphics/program-label-2.jpg','../graphics/program-label-3.jpg');" src="../graphics/program-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
22 | <A href="../migrate.html" onMouseOut="rolloverOff('side-migrate');" onMouseOver="rolloverOn('side-migrate');"><IMG alt="Migration Guide" border="0" height="12" hspace="0" name="side-migrate" onLoad="rolloverLoad('side-migrate','../graphics/migrate-label-2.jpg','../graphics/migrate-label-3.jpg');" src="../graphics/migrate-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
23 |
|
---|
24 | <IMG border="0" height="6" hspace="0" src="../resources/separator.gif" vspace="0" width="120"><BR>
|
---|
25 |
|
---|
26 | <A href="../feedback.html" onMouseOut="rolloverOff('side-feedback');" onMouseOver="rolloverOn('side-feedback');"><IMG alt="Feedback" border="0" height="12" hspace="0" name="side-feedback" onLoad="rolloverLoad('side-feedback','../graphics/feedback-label-2.jpg','../graphics/feedback-label-3.jpg');" src="../graphics/feedback-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
27 | <A href="../bug-report.html" onMouseOut="rolloverOff('side-bug-report');" onMouseOver="rolloverOn('side-bug-report');"><IMG alt="Bug-Reporting" border="0" height="12" hspace="0" name="side-bug-report" onLoad="rolloverLoad('side-bug-report','../graphics/bug-report-label-2.jpg','../graphics/bug-report-label-3.jpg');" src="../graphics/bug-report-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
28 | <A href="../pdf.html" onMouseOut="rolloverOff('side-pdf');" onMouseOver="rolloverOn('side-pdf');"><IMG alt="PDF Document" border="0" height="12" hspace="0" name="side-pdf" onLoad="rolloverLoad('side-pdf','../graphics/pdf-label-2.jpg','../graphics/pdf-label-3.jpg');" src="../graphics/pdf-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
29 |
|
---|
30 | <IMG border="0" height="6" hspace="0" src="../resources/separator.gif" vspace="0" width="120"><BR>
|
---|
31 |
|
---|
32 | <A href="http://xml.apache.org/websrc/cvsweb.cgi/xml-xerces/c/" onMouseOut="rolloverOff('side-ext-100');" onMouseOver="rolloverOn('side-ext-100');"><IMG alt="CVS Repository" border="0" height="12" hspace="0" name="side-ext-100" onLoad="rolloverLoad('side-ext-100','../graphics/ext-100-label-2.jpg','../graphics/ext-100-label-3.jpg');" src="../graphics/ext-100-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
33 |
|
---|
34 | <A href="http://marc.theaimsgroup.com/?l=xerces-c-dev" onMouseOut="rolloverOff('side-ext-102');" onMouseOver="rolloverOn('side-ext-102');"><IMG alt="Mail Archive" border="0" height="12" hspace="0" name="side-ext-102" onLoad="rolloverLoad('side-ext-102','../graphics/ext-102-label-2.jpg','../graphics/ext-102-label-3.jpg');" src="../graphics/ext-102-label-3.jpg" vspace="0" width="120"></A><BR>
|
---|
35 |
|
---|
36 |
|
---|
37 | <IMG border="0" height="14" hspace="0" src="../resources/close.gif" vspace="0" width="120"><BR></TD><TD align="left" valign="top" width="500"><TABLE border="0" cellpadding="3" cellspacing="0"><TR><TD>
|
---|
38 | <TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#FFFFFF" colspan="2" width="494"><TABLE border="0" cellpadding="0" cellspacing="0" width="494"><TR><TD bgcolor="#039acc" height="1" width="1"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#039acc" height="1" width="492"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#039acc" width="1"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#0086b2" width="492"><FONT color="#ffffff" face="arial,helvetica,sanserif" size="+1"><IMG border="0" height="2" hspace="0" src="../resources/void.gif" vspace="0" width="2"><B>API Docs for SAX and DOM</B></FONT></TD><TD bgcolor="#017299" width="1"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="1"></TD></TR><TR><TD bgcolor="#0086b2" height="1" width="1"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="1"></TD><TD bgcolor="#017299" height="1" width="492"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="492"></TD><TD bgcolor="#017299" height="1" width="1"><IMG border="0" height="1" hspace="0" src="../resources/void.gif" vspace="0" width="1"></TD></TR></TABLE></TD></TR><TR><TD width="10"> </TD><TD width="484"><FONT color="#000000" face="arial,helvetica,sanserif">
|
---|
39 |
|
---|
40 | <P>
|
---|
41 | <!-- Generated by Doxygen 1.2.14 -->
|
---|
42 | <center>
|
---|
43 | <a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center>
|
---|
44 | <hr><h1>DOMWriter Class Reference</h1>DOMWriter provides an API for serializing (writing) a DOM document out in an XML document.
|
---|
45 | <a href="#_details">More...</a>
|
---|
46 | <p>
|
---|
47 | <a href="classDOMWriter-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
|
---|
48 | <tr><td colspan=2><br><h2>Public Methods</h2></td></tr>
|
---|
49 | <tr><td colspan="2"><div class="groupHeader">Destructor</div></td></tr>
|
---|
50 | <tr><td nowrap align=right valign=top>virtual </td><td valign=bottom><a class="el" href="classDOMWriter.html#z175_0">~DOMWriter</a> ()</td></tr>
|
---|
51 | <tr><td> </td><td><font size=-1><em>Destructor.</em> <a href="#z175_0">More...</a><em></em></font><br><br></td></tr>
|
---|
52 | <tr><td colspan="2"><div class="groupHeader">Functions introduced in DOM Level 3</div></td></tr>
|
---|
53 | <tr><td nowrap align=right valign=top>virtual bool </td><td valign=bottom><a class="el" href="classDOMWriter.html#z176_0">canSetFeature</a> (const XMLCh *const featName, bool state) const=0</td></tr>
|
---|
54 | <tr><td> </td><td><font size=-1><em>Query whether setting a feature to a specific value is supported.</em> <a href="#z176_0">More...</a><em></em></font><br><br></td></tr>
|
---|
55 | <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classDOMWriter.html#z176_1">setFeature</a> (const XMLCh *const featName, bool state)=0</td></tr>
|
---|
56 | <tr><td> </td><td><font size=-1><em>Set the state of a feature.</em> <a href="#z176_1">More...</a><em></em></font><br><br></td></tr>
|
---|
57 | <tr><td nowrap align=right valign=top>virtual bool </td><td valign=bottom><a class="el" href="classDOMWriter.html#z176_2">getFeature</a> (const XMLCh *const featName) const=0</td></tr>
|
---|
58 | <tr><td> </td><td><font size=-1><em>Look up the value of a feature.</em> <a href="#z176_2">More...</a><em></em></font><br><br></td></tr>
|
---|
59 | <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classDOMWriter.html#z176_3">setEncoding</a> (const XMLCh *const encoding)=0</td></tr>
|
---|
60 | <tr><td> </td><td><font size=-1><em>The character encoding in which the output will be written.</em> <a href="#z176_3">More...</a><em></em></font><br><br></td></tr>
|
---|
61 | <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classDOMWriter.html#z176_4">setNewLine</a> (const XMLCh *const newLine)=0</td></tr>
|
---|
62 | <tr><td> </td><td><font size=-1><em>The end-of-line sequence of characters to be used in the XML being written out.</em> <a href="#z176_4">More...</a><em></em></font><br><br></td></tr>
|
---|
63 | <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classDOMWriter.html#z176_5">setErrorHandler</a> (<a class="el" href="classDOMErrorHandler.html">DOMErrorHandler</a> *errorHandler)=0</td></tr>
|
---|
64 | <tr><td> </td><td><font size=-1><em>The error handler that will receive error notifications during serialization.</em> <a href="#z176_5">More...</a><em></em></font><br><br></td></tr>
|
---|
65 | <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classDOMWriter.html#z176_6">setFilter</a> (<a class="el" href="classDOMWriterFilter.html">DOMWriterFilter</a> *filter)=0</td></tr>
|
---|
66 | <tr><td> </td><td><font size=-1><em>When the application provides a filter, the serializer will call out to the filter before serializing each Node.</em> <a href="#z176_6">More...</a><em></em></font><br><br></td></tr>
|
---|
67 | <tr><td nowrap align=right valign=top>virtual const XMLCh * </td><td valign=bottom><a class="el" href="classDOMWriter.html#z176_7">getEncoding</a> () const=0</td></tr>
|
---|
68 | <tr><td> </td><td><font size=-1><em>Return the character encoding in which the output will be written.</em> <a href="#z176_7">More...</a><em></em></font><br><br></td></tr>
|
---|
69 | <tr><td nowrap align=right valign=top>virtual const XMLCh * </td><td valign=bottom><a class="el" href="classDOMWriter.html#z176_8">getNewLine</a> () const=0</td></tr>
|
---|
70 | <tr><td> </td><td><font size=-1><em>Return the end-of-line sequence of characters to be used in the XML being written out.</em> <a href="#z176_8">More...</a><em></em></font><br><br></td></tr>
|
---|
71 | <tr><td nowrap align=right valign=top>virtual <a class="el" href="classDOMErrorHandler.html">DOMErrorHandler</a> * </td><td valign=bottom><a class="el" href="classDOMWriter.html#z176_9">getErrorHandler</a> () const=0</td></tr>
|
---|
72 | <tr><td> </td><td><font size=-1><em>Return the error handler that will receive error notifications during serialization.</em> <a href="#z176_9">More...</a><em></em></font><br><br></td></tr>
|
---|
73 | <tr><td nowrap align=right valign=top>virtual <a class="el" href="classDOMWriterFilter.html">DOMWriterFilter</a> * </td><td valign=bottom><a class="el" href="classDOMWriter.html#z176_10">getFilter</a> () const=0</td></tr>
|
---|
74 | <tr><td> </td><td><font size=-1><em>Return the WriterFilter used.</em> <a href="#z176_10">More...</a><em></em></font><br><br></td></tr>
|
---|
75 | <tr><td nowrap align=right valign=top>virtual bool </td><td valign=bottom><a class="el" href="classDOMWriter.html#z176_11">writeNode</a> (<a class="el" href="classXMLFormatTarget.html">XMLFormatTarget</a> *const destination, const <a class="el" href="classDOMNode.html">DOMNode</a> &nodeToWrite)=0</td></tr>
|
---|
76 | <tr><td> </td><td><font size=-1><em>Write out the specified node as described above in the description of <code>DOMWriter</code>.</em> <a href="#z176_11">More...</a><em></em></font><br><br></td></tr>
|
---|
77 | <tr><td nowrap align=right valign=top>virtual XMLCh * </td><td valign=bottom><a class="el" href="classDOMWriter.html#z176_12">writeToString</a> (const <a class="el" href="classDOMNode.html">DOMNode</a> &nodeToWrite)=0</td></tr>
|
---|
78 | <tr><td> </td><td><font size=-1><em>Serialize the specified node as described above in the description of <code>DOMWriter</code>.</em> <a href="#z176_12">More...</a><em></em></font><br><br></td></tr>
|
---|
79 | <tr><td colspan="2"><div class="groupHeader">Non-standard Extension</div></td></tr>
|
---|
80 | <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classDOMWriter.html#z177_0">release</a> ()=0</td></tr>
|
---|
81 | <tr><td> </td><td><font size=-1><em>Called to indicate that this Writer is no longer in use and that the implementation may relinquish any resources associated with it.</em> <a href="#z177_0">More...</a><em></em></font><br><br></td></tr>
|
---|
82 | <tr><td colspan=2><br><h2>Protected Methods</h2></td></tr>
|
---|
83 | <tr><td colspan="2"><div class="groupHeader">Hidden constructors</div></td></tr>
|
---|
84 | <tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classDOMWriter.html#z173_0">DOMWriter</a> ()</td></tr>
|
---|
85 | </table>
|
---|
86 | <hr><a name="_details"></a><h2>Detailed Description</h2>
|
---|
87 | DOMWriter provides an API for serializing (writing) a DOM document out in an XML document.
|
---|
88 | <p>
|
---|
89 | The XML data is written to an output stream, the type of which depends on the specific language bindings in use. During serialization of XML data, namespace fixup is done when possible.
|
---|
90 | <p>
|
---|
91 | <code>DOMWriter</code> accepts any node type for serialization. For nodes of type <code>Document</code> or <code>Entity</code>, well formed XML will be created if possible. The serialized output for these node types is either as a Document or an External Entity, respectively, and is acceptable input for an XML parser. For all other types of nodes the serialized form is not specified, but should be something useful to a human for debugging or diagnostic purposes. Note: rigorously designing an external (source) form for stand-alone node types that don't already have one defined in seems a bit much to take on here.
|
---|
92 | <p>
|
---|
93 | Within a Document or Entity being serialized, Nodes are processed as follows Documents are written including an XML declaration and a DTD subset, if one exists in the DOM. Writing a document node serializes the entire document. Entity nodes, when written directly by <code>writeNode</code> defined in the <code>DOMWriter</code> interface, output the entity expansion but no namespace fixup is done. The resulting output will be valid as an external entity. Entity References nodes are serializes as an entity reference of the form <code>"&entityName;"</code>) in the output. Child nodes (the expansion) of the entity reference are ignored. CDATA sections containing content characters that can not be represented in the specified output encoding are handled according to the "split-cdata-sections" feature.If the feature is <code>true</code>, CDATA sections are split, and the unrepresentable characters are serialized as numeric character references in ordinary content. The exact position and number of splits is not specified. If the feature is <code>false</code>, unrepresentable characters in a CDATA section are reported as errors. The error is not recoverable - there is no mechanism for supplying alternative characters and continuing with the serialization. All other node types (<a class="el" href="classDOMElement.html">DOMElement</a>, <a class="el" href="classDOMText.html">DOMText</a>, etc.) are serialized to their corresponding XML source form.
|
---|
94 | <p>
|
---|
95 | Within the character data of a document (outside of markup), any characters that cannot be represented directly are replaced with character references. Occurrences of '<' and '&' are replaced by the predefined entities &lt; and &amp. The other predefined entities (&gt, &apos, etc.) are not used; these characters can be included directly. Any character that can not be represented directly in the output character encoding is serialized as a numeric character reference.
|
---|
96 | <p>
|
---|
97 | <a class="el" href="classAttributes.html">Attributes</a> not containing quotes are serialized in quotes. <a class="el" href="classAttributes.html">Attributes</a> containing quotes but no apostrophes are serialized in apostrophes (single quotes). <a class="el" href="classAttributes.html">Attributes</a> containing both forms of quotes are serialized in quotes, with quotes within the value represented by the predefined entity &quot;. Any character that can not be represented directly in the output character encoding is serialized as a numeric character reference.
|
---|
98 | <p>
|
---|
99 | Within markup, but outside of attributes, any occurrence of a character that cannot be represented in the output character encoding is reported as an error. An example would be serializing the element <LaCañada/> with the encoding="us-ascii".
|
---|
100 | <p>
|
---|
101 | When requested by setting the <code>normalize-characters</code> feature on <code>DOMWriter</code>, all data to be serialized, both markup and character data, is W3C Text normalized according to the rules defined in . The W3C Text normalization process affects only the data as it is being written; it does not alter the DOM's view of the document after serialization has completed.
|
---|
102 | <p>
|
---|
103 | Namespaces are fixed up during serialization, the serialization process will verify that namespace declarations, namespace prefixes and the namespace URIs associated with Elements and <a class="el" href="classAttributes.html">Attributes</a> are consistent. If inconsistencies are found, the serialized form of the document will be altered to remove them. The algorithm used for doing the namespace fixup while seralizing a document is a combination of the algorithms used for lookupNamespaceURI and lookupNamespacePrefix . previous paragraph to be defined closer here.
|
---|
104 | <p>
|
---|
105 | Any changes made affect only the namespace prefixes and declarations appearing in the serialized data. The DOM's view of the document is not altered by the serialization operation, and does not reflect any changes made to namespace declarations or prefixes in the serialized output.
|
---|
106 | <p>
|
---|
107 | While serializing a document the serializer will write out non-specified values (such as attributes whose <code>specified</code> is <code>false</code>) if the <code>output-default-values</code> feature is set to <code>true</code>. If the <code>output-default-values</code> flag is set to <code>false</code> and the <code>use-abstract-schema</code> feature is set to <code>true</code> the abstract schema will be used to determine if a value is specified or not, if <code>use-abstract-schema</code> is not set the <code>specified</code> flag on attribute nodes is used to determine if attribute values should be written out.
|
---|
108 | <p>
|
---|
109 | Ref to Core spec (1.1.9, XML namespaces, 5th paragraph) entity ref description about warning about unbound entity refs. Entity refs are always serialized as &foo;, also mention this in the load part of this spec.
|
---|
110 | <p>
|
---|
111 | When serializing a document the DOMWriter checks to see if the document element in the document is a DOM Level 1 element or a DOM Level 2 (or higher) element (this check is done by looking at the localName of the root element). If the root element is a DOM Level 1 element then the DOMWriter will issue an error if a DOM Level 2 (or higher) element is found while serializing. Likewise if the document element is a DOM Level 2 (or higher) element and the DOMWriter sees a DOM Level 1 element an error is issued. Mixing DOM Level 1 elements with DOM Level 2 (or higher) is not supported.
|
---|
112 | <p>
|
---|
113 | <code>DOMWriter</code>s have a number of named features that can be queried or set. The name of <code>DOMWriter</code> features must be valid XML names. Implementation specific features (extensions) should choose an implementation dependent prefix to avoid name collisions.
|
---|
114 | <p>
|
---|
115 | Here is a list of properties that must be recognized by all implementations.
|
---|
116 | <dl compact>
|
---|
117 | <dt><code>"normalize-characters"</code> <dd>
|
---|
118 | <dl compact>
|
---|
119 | <dt><code>true</code> <dd>[ optional] (default) Perform the W3C Text Normalization of the characters in document as they are written out. Only the characters being written are (potentially) altered. The DOM document itself is unchanged. <dt> <code>false</code> <dd>[required] do not perform character normalization.
|
---|
120 | </dl>
|
---|
121 | <dt> <code>"split-cdata-sections"</code> <dd>
|
---|
122 | <dl compact>
|
---|
123 | <dt><code>true</code> <dd>[required] (default) Split CDATA sections containing the CDATA section termination marker ']]>' or characters that can not be represented in the output encoding, and output the characters using numeric character references. If a CDATA section is split a warning is issued. <dt><code>false</code> <dd>[ required] Signal an error if a <code>CDATASection</code> contains an unrepresentable character.
|
---|
124 | </dl>
|
---|
125 | <dt><code>"validation"</code> <dd>
|
---|
126 | <dl compact>
|
---|
127 | <dt><code>true</code> <dd>[ optional] Use the abstract schema to validate the document as it is being serialized. If validation errors are found the error handler is notified about the error. Setting this state will also set the feature <code>use-abstract-schema</code> to <code>true</code>. <dt><code>false</code> <dd>[ required] (default) Don't validate the document as it is being serialized.
|
---|
128 | </dl>
|
---|
129 | <dt><code>"expand-entity-references"</code> <dd>
|
---|
130 | <dl compact>
|
---|
131 | <dt><code>true</code> <dd>[ optional] Expand <code>EntityReference</code> nodes when serializing. <dt> <code>false</code> <dd>[required] (default) Serialize all <code>EntityReference</code> nodes as XML entity references.
|
---|
132 | </dl>
|
---|
133 | <dt> <code>"whitespace-in-element-content"</code> <dd>
|
---|
134 | <dl compact>
|
---|
135 | <dt><code>true</code> <dd>[required] ( default) Output all white spaces in the document. <dt><code>false</code> <dd>[ optional] Only output white space that is not within element content. The implementation is expected to use the <code>isWhitespaceInElementContent</code> flag on <code>Text</code> nodes to determine if a text node should be written out or not.
|
---|
136 | </dl>
|
---|
137 | <dt> <code>"discard-default-content"</code> <dd>
|
---|
138 | <dl compact>
|
---|
139 | <dt><code>true</code> <dd>[required] (default ) Use whatever information available to the implementation (i.e. XML schema, DTD, the <code>specified</code> flag on <code>Attr</code> nodes, and so on) to decide what attributes and content should be serialized or not. Note that the <code>specified</code> flag on <code>Attr</code> nodes in itself is not always reliable, it is only reliable when it is set to <code>false</code> since the only case where it can be set to <code>false</code> is if the attribute was created by a Level 1 implementation. <dt><code>false</code> <dd>[required] Output all attributes and all content.
|
---|
140 | </dl>
|
---|
141 | <dt><code>"format-canonical"</code> <dd>
|
---|
142 | <dl compact>
|
---|
143 | <dt><code>true</code> <dd>[optional] This formatting writes the document according to the rules specified in . Setting this feature to true will set the feature "format-pretty-print" to false. <dt><code>false</code> <dd>[required] (default) Don't canonicalize the output.
|
---|
144 | </dl>
|
---|
145 | <dt><code>"format-pretty-print"</code> <dd>
|
---|
146 | <dl compact>
|
---|
147 | <dt><code>true</code> <dd>[optional] Formatting the output by adding whitespace to produce a pretty-printed, indented, human-readable form. The exact form of the transformations is not specified by this specification. Setting this feature to true will set the feature "format-canonical" to false. <dt><code>false</code> <dd>[required] (default) Don't pretty-print the result.
|
---|
148 | </dl>
|
---|
149 |
|
---|
150 | </dl>
|
---|
151 |
|
---|
152 | <p>
|
---|
153 | See also the <a href="http://www.w3.org/TR/2002/WD-DOM-Level-3-ASLS-20020409">Document Object Model (DOM) Level 3 Abstract Schemas and Load and Save Specification</a>.
|
---|
154 | <p>
|
---|
155 | <dl compact><dt><b>
|
---|
156 | Since: </b><dd>
|
---|
157 | DOM Level 3 </dl>
|
---|
158 | <p>
|
---|
159 | <hr><h2>Constructor & Destructor Documentation</h2>
|
---|
160 | <a name="z173_0" doxytag="DOMWriter::DOMWriter"></a><p>
|
---|
161 | <table width="100%" cellpadding="2" cellspacing="0" border="0">
|
---|
162 | <tr>
|
---|
163 | <td class="md">
|
---|
164 | <table cellpadding="0" cellspacing="0" border="0">
|
---|
165 | <tr>
|
---|
166 | <td class="md" nowrap valign="top"> DOMWriter::DOMWriter </td>
|
---|
167 | <td class="md" valign="top">( </td>
|
---|
168 | <td class="mdname1" valign="top" nowrap> </td>
|
---|
169 | <td class="md" valign="top">) </td>
|
---|
170 | <td class="md" nowrap><code> [protected]</code></td>
|
---|
171 | </tr>
|
---|
172 |
|
---|
173 | </table>
|
---|
174 | </td>
|
---|
175 | </tr>
|
---|
176 | </table>
|
---|
177 | <table cellspacing=5 cellpadding=0 border=0>
|
---|
178 | <tr>
|
---|
179 | <td>
|
---|
180 |
|
---|
181 | </td>
|
---|
182 | <td>
|
---|
183 |
|
---|
184 | <p>
|
---|
185 | </td>
|
---|
186 | </tr>
|
---|
187 | </table>
|
---|
188 | <a name="z175_0" doxytag="DOMWriter::~DOMWriter"></a><p>
|
---|
189 | <table width="100%" cellpadding="2" cellspacing="0" border="0">
|
---|
190 | <tr>
|
---|
191 | <td class="md">
|
---|
192 | <table cellpadding="0" cellspacing="0" border="0">
|
---|
193 | <tr>
|
---|
194 | <td class="md" nowrap valign="top"> virtual DOMWriter::~DOMWriter </td>
|
---|
195 | <td class="md" valign="top">( </td>
|
---|
196 | <td class="mdname1" valign="top" nowrap> </td>
|
---|
197 | <td class="md" valign="top">) </td>
|
---|
198 | <td class="md" nowrap><code> [virtual]</code></td>
|
---|
199 | </tr>
|
---|
200 |
|
---|
201 | </table>
|
---|
202 | </td>
|
---|
203 | </tr>
|
---|
204 | </table>
|
---|
205 | <table cellspacing=5 cellpadding=0 border=0>
|
---|
206 | <tr>
|
---|
207 | <td>
|
---|
208 |
|
---|
209 | </td>
|
---|
210 | <td>
|
---|
211 |
|
---|
212 | <p>
|
---|
213 | Destructor.
|
---|
214 | <p>
|
---|
215 | </td>
|
---|
216 | </tr>
|
---|
217 | </table>
|
---|
218 | <hr><h2>Member Function Documentation</h2>
|
---|
219 | <a name="z176_0" doxytag="DOMWriter::canSetFeature"></a><p>
|
---|
220 | <table width="100%" cellpadding="2" cellspacing="0" border="0">
|
---|
221 | <tr>
|
---|
222 | <td class="md">
|
---|
223 | <table cellpadding="0" cellspacing="0" border="0">
|
---|
224 | <tr>
|
---|
225 | <td class="md" nowrap valign="top"> virtual bool DOMWriter::canSetFeature </td>
|
---|
226 | <td class="md" valign="top">( </td>
|
---|
227 | <td class="md" nowrap valign="top">const XMLCh *const </td>
|
---|
228 | <td class="mdname" nowrap> <em>featName</em>, </td>
|
---|
229 | </tr>
|
---|
230 | <tr>
|
---|
231 | <td></td>
|
---|
232 | <td></td>
|
---|
233 | <td class="md" nowrap>bool </td>
|
---|
234 | <td class="mdname" nowrap> <em>state</em></td>
|
---|
235 | </tr>
|
---|
236 | <tr>
|
---|
237 | <td></td>
|
---|
238 | <td class="md">) </td>
|
---|
239 | <td class="md" colspan="2"> const<code> [pure virtual]</code></td>
|
---|
240 | </tr>
|
---|
241 |
|
---|
242 | </table>
|
---|
243 | </td>
|
---|
244 | </tr>
|
---|
245 | </table>
|
---|
246 | <table cellspacing=5 cellpadding=0 border=0>
|
---|
247 | <tr>
|
---|
248 | <td>
|
---|
249 |
|
---|
250 | </td>
|
---|
251 | <td>
|
---|
252 |
|
---|
253 | <p>
|
---|
254 | Query whether setting a feature to a specific value is supported.
|
---|
255 | <p>
|
---|
256 | <br>
|
---|
257 | The feature name has the same form as a DOM hasFeature string.
|
---|
258 | <p>
|
---|
259 |
|
---|
260 | <p>
|
---|
261 | <b>"Experimental - subject to change"</b><dl compact><dt><b>
|
---|
262 | Parameters: </b><dd>
|
---|
263 | <table border=0 cellspacing=2 cellpadding=0>
|
---|
264 | <tr><td valign=top><em>featName</em> </td><td>
|
---|
265 | The feature name, which is a DOM has-feature style string. </td></tr>
|
---|
266 | <tr><td valign=top><em>state</em> </td><td>
|
---|
267 | The requested state of the feature (<code>true</code> or <code>false</code>). </td></tr>
|
---|
268 | </table>
|
---|
269 | </dl><dl compact><dt><b>
|
---|
270 | Returns: </b><dd>
|
---|
271 | <code>true</code> if the feature could be successfully set to the specified value, or <code>false</code> if the feature is not recognized or the requested value is not supported. The value of the feature itself is not changed. </dl><dl compact><dt><b>
|
---|
272 | Since: </b><dd>
|
---|
273 | DOM Level 3 </dl> </td>
|
---|
274 | </tr>
|
---|
275 | </table>
|
---|
276 | <a name="z176_7" doxytag="DOMWriter::getEncoding"></a><p>
|
---|
277 | <table width="100%" cellpadding="2" cellspacing="0" border="0">
|
---|
278 | <tr>
|
---|
279 | <td class="md">
|
---|
280 | <table cellpadding="0" cellspacing="0" border="0">
|
---|
281 | <tr>
|
---|
282 | <td class="md" nowrap valign="top"> virtual const XMLCh* DOMWriter::getEncoding </td>
|
---|
283 | <td class="md" valign="top">( </td>
|
---|
284 | <td class="mdname1" valign="top" nowrap> </td>
|
---|
285 | <td class="md" valign="top">) </td>
|
---|
286 | <td class="md" nowrap> const<code> [pure virtual]</code></td>
|
---|
287 | </tr>
|
---|
288 |
|
---|
289 | </table>
|
---|
290 | </td>
|
---|
291 | </tr>
|
---|
292 | </table>
|
---|
293 | <table cellspacing=5 cellpadding=0 border=0>
|
---|
294 | <tr>
|
---|
295 | <td>
|
---|
296 |
|
---|
297 | </td>
|
---|
298 | <td>
|
---|
299 |
|
---|
300 | <p>
|
---|
301 | Return the character encoding in which the output will be written.
|
---|
302 | <p>
|
---|
303 |
|
---|
304 | <p>
|
---|
305 | <b>"Experimental - subject to change"</b>
|
---|
306 | <p>
|
---|
307 | <dl compact><dt><b>
|
---|
308 | Returns: </b><dd>
|
---|
309 | The character encoding used. </dl><dl compact><dt><b>
|
---|
310 | See also: </b><dd>
|
---|
311 | <a class="el" href="classDOMWriter.html#z176_3">setEncoding</a> </dl><dl compact><dt><b>
|
---|
312 | Since: </b><dd>
|
---|
313 | DOM Level 3 </dl> </td>
|
---|
314 | </tr>
|
---|
315 | </table>
|
---|
316 | <a name="z176_9" doxytag="DOMWriter::getErrorHandler"></a><p>
|
---|
317 | <table width="100%" cellpadding="2" cellspacing="0" border="0">
|
---|
318 | <tr>
|
---|
319 | <td class="md">
|
---|
320 | <table cellpadding="0" cellspacing="0" border="0">
|
---|
321 | <tr>
|
---|
322 | <td class="md" nowrap valign="top"> virtual <a class="el" href="classDOMErrorHandler.html">DOMErrorHandler</a>* DOMWriter::getErrorHandler </td>
|
---|
323 | <td class="md" valign="top">( </td>
|
---|
324 | <td class="mdname1" valign="top" nowrap> </td>
|
---|
325 | <td class="md" valign="top">) </td>
|
---|
326 | <td class="md" nowrap> const<code> [pure virtual]</code></td>
|
---|
327 | </tr>
|
---|
328 |
|
---|
329 | </table>
|
---|
330 | </td>
|
---|
331 | </tr>
|
---|
332 | </table>
|
---|
333 | <table cellspacing=5 cellpadding=0 border=0>
|
---|
334 | <tr>
|
---|
335 | <td>
|
---|
336 |
|
---|
337 | </td>
|
---|
338 | <td>
|
---|
339 |
|
---|
340 | <p>
|
---|
341 | Return the error handler that will receive error notifications during serialization.
|
---|
342 | <p>
|
---|
343 |
|
---|
344 | <p>
|
---|
345 | <b>"Experimental - subject to change"</b>
|
---|
346 | <p>
|
---|
347 | <dl compact><dt><b>
|
---|
348 | Returns: </b><dd>
|
---|
349 | The error handler to be used. </dl><dl compact><dt><b>
|
---|
350 | See also: </b><dd>
|
---|
351 | <a class="el" href="classDOMWriter.html#z176_5">setErrorHandler</a> </dl><dl compact><dt><b>
|
---|
352 | Since: </b><dd>
|
---|
353 | DOM Level 3 </dl> </td>
|
---|
354 | </tr>
|
---|
355 | </table>
|
---|
356 | <a name="z176_2" doxytag="DOMWriter::getFeature"></a><p>
|
---|
357 | <table width="100%" cellpadding="2" cellspacing="0" border="0">
|
---|
358 | <tr>
|
---|
359 | <td class="md">
|
---|
360 | <table cellpadding="0" cellspacing="0" border="0">
|
---|
361 | <tr>
|
---|
362 | <td class="md" nowrap valign="top"> virtual bool DOMWriter::getFeature </td>
|
---|
363 | <td class="md" valign="top">( </td>
|
---|
364 | <td class="md" nowrap valign="top">const XMLCh *const </td>
|
---|
365 | <td class="mdname1" valign="top" nowrap> <em>featName</em> </td>
|
---|
366 | <td class="md" valign="top">) </td>
|
---|
367 | <td class="md" nowrap> const<code> [pure virtual]</code></td>
|
---|
368 | </tr>
|
---|
369 |
|
---|
370 | </table>
|
---|
371 | </td>
|
---|
372 | </tr>
|
---|
373 | </table>
|
---|
374 | <table cellspacing=5 cellpadding=0 border=0>
|
---|
375 | <tr>
|
---|
376 | <td>
|
---|
377 |
|
---|
378 | </td>
|
---|
379 | <td>
|
---|
380 |
|
---|
381 | <p>
|
---|
382 | Look up the value of a feature.
|
---|
383 | <p>
|
---|
384 | <br>
|
---|
385 | The feature name has the same form as a DOM hasFeature string <dl compact><dt><b>
|
---|
386 | Parameters: </b><dd>
|
---|
387 | <table border=0 cellspacing=2 cellpadding=0>
|
---|
388 | <tr><td valign=top><em>featName</em> </td><td>
|
---|
389 | The feature name, which is a string with DOM has-feature syntax. </td></tr>
|
---|
390 | </table>
|
---|
391 | </dl><dl compact><dt><b>
|
---|
392 | Returns: </b><dd>
|
---|
393 | The current state of the feature (<code>true</code> or <code>false</code>). </dl><dl compact><dt><b>
|
---|
394 | Exceptions: </b><dd>
|
---|
395 | <table border=0 cellspacing=2 cellpadding=0>
|
---|
396 | <tr><td valign=top><em><a class="el" href="classDOMException.html">DOMException</a></em> </td><td>
|
---|
397 | Raise a NOT_FOUND_ERR When the <code>DOMWriter</code> does not recognize the feature name.</td></tr>
|
---|
398 | </table>
|
---|
399 | </dl>
|
---|
400 | <p>
|
---|
401 | <b>"Experimental - subject to change"</b>
|
---|
402 | <p>
|
---|
403 | <dl compact><dt><b>
|
---|
404 | See also: </b><dd>
|
---|
405 | <a class="el" href="classDOMWriter.html#z176_1">setFeature</a> </dl><dl compact><dt><b>
|
---|
406 | Since: </b><dd>
|
---|
407 | DOM Level 3 </dl> </td>
|
---|
408 | </tr>
|
---|
409 | </table>
|
---|
410 | <a name="z176_10" doxytag="DOMWriter::getFilter"></a><p>
|
---|
411 | <table width="100%" cellpadding="2" cellspacing="0" border="0">
|
---|
412 | <tr>
|
---|
413 | <td class="md">
|
---|
414 | <table cellpadding="0" cellspacing="0" border="0">
|
---|
415 | <tr>
|
---|
416 | <td class="md" nowrap valign="top"> virtual <a class="el" href="classDOMWriterFilter.html">DOMWriterFilter</a>* DOMWriter::getFilter </td>
|
---|
417 | <td class="md" valign="top">( </td>
|
---|
418 | <td class="mdname1" valign="top" nowrap> </td>
|
---|
419 | <td class="md" valign="top">) </td>
|
---|
420 | <td class="md" nowrap> const<code> [pure virtual]</code></td>
|
---|
421 | </tr>
|
---|
422 |
|
---|
423 | </table>
|
---|
424 | </td>
|
---|
425 | </tr>
|
---|
426 | </table>
|
---|
427 | <table cellspacing=5 cellpadding=0 border=0>
|
---|
428 | <tr>
|
---|
429 | <td>
|
---|
430 |
|
---|
431 | </td>
|
---|
432 | <td>
|
---|
433 |
|
---|
434 | <p>
|
---|
435 | Return the WriterFilter used.
|
---|
436 | <p>
|
---|
437 |
|
---|
438 | <p>
|
---|
439 | <b>"Experimental - subject to change"</b>
|
---|
440 | <p>
|
---|
441 | <dl compact><dt><b>
|
---|
442 | Returns: </b><dd>
|
---|
443 | The writer filter used. </dl><dl compact><dt><b>
|
---|
444 | See also: </b><dd>
|
---|
445 | <a class="el" href="classDOMWriter.html#z176_6">setFilter</a> </dl><dl compact><dt><b>
|
---|
446 | Since: </b><dd>
|
---|
447 | DOM Level 3 </dl> </td>
|
---|
448 | </tr>
|
---|
449 | </table>
|
---|
450 | <a name="z176_8" doxytag="DOMWriter::getNewLine"></a><p>
|
---|
451 | <table width="100%" cellpadding="2" cellspacing="0" border="0">
|
---|
452 | <tr>
|
---|
453 | <td class="md">
|
---|
454 | <table cellpadding="0" cellspacing="0" border="0">
|
---|
455 | <tr>
|
---|
456 | <td class="md" nowrap valign="top"> virtual const XMLCh* DOMWriter::getNewLine </td>
|
---|
457 | <td class="md" valign="top">( </td>
|
---|
458 | <td class="mdname1" valign="top" nowrap> </td>
|
---|
459 | <td class="md" valign="top">) </td>
|
---|
460 | <td class="md" nowrap> const<code> [pure virtual]</code></td>
|
---|
461 | </tr>
|
---|
462 |
|
---|
463 | </table>
|
---|
464 | </td>
|
---|
465 | </tr>
|
---|
466 | </table>
|
---|
467 | <table cellspacing=5 cellpadding=0 border=0>
|
---|
468 | <tr>
|
---|
469 | <td>
|
---|
470 |
|
---|
471 | </td>
|
---|
472 | <td>
|
---|
473 |
|
---|
474 | <p>
|
---|
475 | Return the end-of-line sequence of characters to be used in the XML being written out.
|
---|
476 | <p>
|
---|
477 |
|
---|
478 | <p>
|
---|
479 | <b>"Experimental - subject to change"</b>
|
---|
480 | <p>
|
---|
481 | <dl compact><dt><b>
|
---|
482 | Returns: </b><dd>
|
---|
483 | The end-of-line sequence of characters to be used. </dl><dl compact><dt><b>
|
---|
484 | See also: </b><dd>
|
---|
485 | <a class="el" href="classDOMWriter.html#z176_4">setNewLine</a> </dl><dl compact><dt><b>
|
---|
486 | Since: </b><dd>
|
---|
487 | DOM Level 3 </dl> </td>
|
---|
488 | </tr>
|
---|
489 | </table>
|
---|
490 | <a name="z177_0" doxytag="DOMWriter::release"></a><p>
|
---|
491 | <table width="100%" cellpadding="2" cellspacing="0" border="0">
|
---|
492 | <tr>
|
---|
493 | <td class="md">
|
---|
494 | <table cellpadding="0" cellspacing="0" border="0">
|
---|
495 | <tr>
|
---|
496 | <td class="md" nowrap valign="top"> virtual void DOMWriter::release </td>
|
---|
497 | <td class="md" valign="top">( </td>
|
---|
498 | <td class="mdname1" valign="top" nowrap> </td>
|
---|
499 | <td class="md" valign="top">) </td>
|
---|
500 | <td class="md" nowrap><code> [pure virtual]</code></td>
|
---|
501 | </tr>
|
---|
502 |
|
---|
503 | </table>
|
---|
504 | </td>
|
---|
505 | </tr>
|
---|
506 | </table>
|
---|
507 | <table cellspacing=5 cellpadding=0 border=0>
|
---|
508 | <tr>
|
---|
509 | <td>
|
---|
510 |
|
---|
511 | </td>
|
---|
512 | <td>
|
---|
513 |
|
---|
514 | <p>
|
---|
515 | Called to indicate that this Writer is no longer in use and that the implementation may relinquish any resources associated with it.
|
---|
516 | <p>
|
---|
517 | Access to a released object will lead to unexpected result. </td>
|
---|
518 | </tr>
|
---|
519 | </table>
|
---|
520 | <a name="z176_3" doxytag="DOMWriter::setEncoding"></a><p>
|
---|
521 | <table width="100%" cellpadding="2" cellspacing="0" border="0">
|
---|
522 | <tr>
|
---|
523 | <td class="md">
|
---|
524 | <table cellpadding="0" cellspacing="0" border="0">
|
---|
525 | <tr>
|
---|
526 | <td class="md" nowrap valign="top"> virtual void DOMWriter::setEncoding </td>
|
---|
527 | <td class="md" valign="top">( </td>
|
---|
528 | <td class="md" nowrap valign="top">const XMLCh *const </td>
|
---|
529 | <td class="mdname1" valign="top" nowrap> <em>encoding</em> </td>
|
---|
530 | <td class="md" valign="top">) </td>
|
---|
531 | <td class="md" nowrap><code> [pure virtual]</code></td>
|
---|
532 | </tr>
|
---|
533 |
|
---|
534 | </table>
|
---|
535 | </td>
|
---|
536 | </tr>
|
---|
537 | </table>
|
---|
538 | <table cellspacing=5 cellpadding=0 border=0>
|
---|
539 | <tr>
|
---|
540 | <td>
|
---|
541 |
|
---|
542 | </td>
|
---|
543 | <td>
|
---|
544 |
|
---|
545 | <p>
|
---|
546 | The character encoding in which the output will be written.
|
---|
547 | <p>
|
---|
548 | <br>
|
---|
549 | 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 <code>null</code> 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. <br>
|
---|
550 | The default value is <code>null</code>.
|
---|
551 | <p>
|
---|
552 |
|
---|
553 | <p>
|
---|
554 | <b>"Experimental - subject to change"</b><dl compact><dt><b>
|
---|
555 | Parameters: </b><dd>
|
---|
556 | <table border=0 cellspacing=2 cellpadding=0>
|
---|
557 | <tr><td valign=top><em>encoding</em> </td><td>
|
---|
558 | The character encoding in which the output will be written. </td></tr>
|
---|
559 | </table>
|
---|
560 | </dl><dl compact><dt><b>
|
---|
561 | See also: </b><dd>
|
---|
562 | <a class="el" href="classDOMWriter.html#z176_7">getEncoding</a> </dl><dl compact><dt><b>
|
---|
563 | Since: </b><dd>
|
---|
564 | DOM Level 3 </dl> </td>
|
---|
565 | </tr>
|
---|
566 | </table>
|
---|
567 | <a name="z176_5" doxytag="DOMWriter::setErrorHandler"></a><p>
|
---|
568 | <table width="100%" cellpadding="2" cellspacing="0" border="0">
|
---|
569 | <tr>
|
---|
570 | <td class="md">
|
---|
571 | <table cellpadding="0" cellspacing="0" border="0">
|
---|
572 | <tr>
|
---|
573 | <td class="md" nowrap valign="top"> virtual void DOMWriter::setErrorHandler </td>
|
---|
574 | <td class="md" valign="top">( </td>
|
---|
575 | <td class="md" nowrap valign="top"><a class="el" href="classDOMErrorHandler.html">DOMErrorHandler</a> * </td>
|
---|
576 | <td class="mdname1" valign="top" nowrap> <em>errorHandler</em> </td>
|
---|
577 | <td class="md" valign="top">) </td>
|
---|
578 | <td class="md" nowrap><code> [pure virtual]</code></td>
|
---|
579 | </tr>
|
---|
580 |
|
---|
581 | </table>
|
---|
582 | </td>
|
---|
583 | </tr>
|
---|
584 | </table>
|
---|
585 | <table cellspacing=5 cellpadding=0 border=0>
|
---|
586 | <tr>
|
---|
587 | <td>
|
---|
588 |
|
---|
589 | </td>
|
---|
590 | <td>
|
---|
591 |
|
---|
592 | <p>
|
---|
593 | The error handler that will receive error notifications during serialization.
|
---|
594 | <p>
|
---|
595 | 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.
|
---|
596 | <p>
|
---|
597 |
|
---|
598 | <p>
|
---|
599 | <b>"Experimental - subject to change"</b><dl compact><dt><b>
|
---|
600 | Parameters: </b><dd>
|
---|
601 | <table border=0 cellspacing=2 cellpadding=0>
|
---|
602 | <tr><td valign=top><em>errorHandler</em> </td><td>
|
---|
603 | The error handler to be used. </td></tr>
|
---|
604 | </table>
|
---|
605 | </dl><dl compact><dt><b>
|
---|
606 | See also: </b><dd>
|
---|
607 | <a class="el" href="classDOMWriter.html#z176_9">getErrorHandler</a> </dl><dl compact><dt><b>
|
---|
608 | Since: </b><dd>
|
---|
609 | DOM Level 3 </dl> </td>
|
---|
610 | </tr>
|
---|
611 | </table>
|
---|
612 | <a name="z176_1" doxytag="DOMWriter::setFeature"></a><p>
|
---|
613 | <table width="100%" cellpadding="2" cellspacing="0" border="0">
|
---|
614 | <tr>
|
---|
615 | <td class="md">
|
---|
616 | <table cellpadding="0" cellspacing="0" border="0">
|
---|
617 | <tr>
|
---|
618 | <td class="md" nowrap valign="top"> virtual void DOMWriter::setFeature </td>
|
---|
619 | <td class="md" valign="top">( </td>
|
---|
620 | <td class="md" nowrap valign="top">const XMLCh *const </td>
|
---|
621 | <td class="mdname" nowrap> <em>featName</em>, </td>
|
---|
622 | </tr>
|
---|
623 | <tr>
|
---|
624 | <td></td>
|
---|
625 | <td></td>
|
---|
626 | <td class="md" nowrap>bool </td>
|
---|
627 | <td class="mdname" nowrap> <em>state</em></td>
|
---|
628 | </tr>
|
---|
629 | <tr>
|
---|
630 | <td></td>
|
---|
631 | <td class="md">) </td>
|
---|
632 | <td class="md" colspan="2"><code> [pure virtual]</code></td>
|
---|
633 | </tr>
|
---|
634 |
|
---|
635 | </table>
|
---|
636 | </td>
|
---|
637 | </tr>
|
---|
638 | </table>
|
---|
639 | <table cellspacing=5 cellpadding=0 border=0>
|
---|
640 | <tr>
|
---|
641 | <td>
|
---|
642 |
|
---|
643 | </td>
|
---|
644 | <td>
|
---|
645 |
|
---|
646 | <p>
|
---|
647 | Set the state of a feature.
|
---|
648 | <p>
|
---|
649 | <br>
|
---|
650 | The feature name has the same form as a DOM hasFeature string. <br>
|
---|
651 | It is possible for a <code>DOMWriter</code> to recognize a feature name but to be unable to set its value.
|
---|
652 | <p>
|
---|
653 |
|
---|
654 | <p>
|
---|
655 | <b>"Experimental - subject to change"</b><dl compact><dt><b>
|
---|
656 | Parameters: </b><dd>
|
---|
657 | <table border=0 cellspacing=2 cellpadding=0>
|
---|
658 | <tr><td valign=top><em>featName</em> </td><td>
|
---|
659 | The feature name. </td></tr>
|
---|
660 | <tr><td valign=top><em>state</em> </td><td>
|
---|
661 | The requested state of the feature (<code>true</code> or <code>false</code>). </td></tr>
|
---|
662 | </table>
|
---|
663 | </dl><dl compact><dt><b>
|
---|
664 | Exceptions: </b><dd>
|
---|
665 | <table border=0 cellspacing=2 cellpadding=0>
|
---|
666 | <tr><td valign=top><em><a class="el" href="classDOMException.html">DOMException</a></em> </td><td>
|
---|
667 | Raise a NOT_SUPPORTED_ERR exception when the <code>DOMWriter</code> recognizes the feature name but cannot set the requested value. <br>
|
---|
668 | Raise a NOT_FOUND_ERR When the <code>DOMWriter</code> does not recognize the feature name. </td></tr>
|
---|
669 | </table>
|
---|
670 | </dl><dl compact><dt><b>
|
---|
671 | See also: </b><dd>
|
---|
672 | <a class="el" href="classDOMWriter.html#z176_2">getFeature</a> </dl><dl compact><dt><b>
|
---|
673 | Since: </b><dd>
|
---|
674 | DOM Level 3 </dl> </td>
|
---|
675 | </tr>
|
---|
676 | </table>
|
---|
677 | <a name="z176_6" doxytag="DOMWriter::setFilter"></a><p>
|
---|
678 | <table width="100%" cellpadding="2" cellspacing="0" border="0">
|
---|
679 | <tr>
|
---|
680 | <td class="md">
|
---|
681 | <table cellpadding="0" cellspacing="0" border="0">
|
---|
682 | <tr>
|
---|
683 | <td class="md" nowrap valign="top"> virtual void DOMWriter::setFilter </td>
|
---|
684 | <td class="md" valign="top">( </td>
|
---|
685 | <td class="md" nowrap valign="top"><a class="el" href="classDOMWriterFilter.html">DOMWriterFilter</a> * </td>
|
---|
686 | <td class="mdname1" valign="top" nowrap> <em>filter</em> </td>
|
---|
687 | <td class="md" valign="top">) </td>
|
---|
688 | <td class="md" nowrap><code> [pure virtual]</code></td>
|
---|
689 | </tr>
|
---|
690 |
|
---|
691 | </table>
|
---|
692 | </td>
|
---|
693 | </tr>
|
---|
694 | </table>
|
---|
695 | <table cellspacing=5 cellpadding=0 border=0>
|
---|
696 | <tr>
|
---|
697 | <td>
|
---|
698 |
|
---|
699 | </td>
|
---|
700 | <td>
|
---|
701 |
|
---|
702 | <p>
|
---|
703 | When the application provides a filter, the serializer will call out to the filter before serializing each Node.
|
---|
704 | <p>
|
---|
705 | 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.
|
---|
706 | <p>
|
---|
707 |
|
---|
708 | <p>
|
---|
709 | <b>"Experimental - subject to change"</b><dl compact><dt><b>
|
---|
710 | Parameters: </b><dd>
|
---|
711 | <table border=0 cellspacing=2 cellpadding=0>
|
---|
712 | <tr><td valign=top><em>filter</em> </td><td>
|
---|
713 | The writer filter to be used. </td></tr>
|
---|
714 | </table>
|
---|
715 | </dl><dl compact><dt><b>
|
---|
716 | See also: </b><dd>
|
---|
717 | <a class="el" href="classDOMWriter.html#z176_10">getFilter</a> </dl><dl compact><dt><b>
|
---|
718 | Since: </b><dd>
|
---|
719 | DOM Level 3 </dl> </td>
|
---|
720 | </tr>
|
---|
721 | </table>
|
---|
722 | <a name="z176_4" doxytag="DOMWriter::setNewLine"></a><p>
|
---|
723 | <table width="100%" cellpadding="2" cellspacing="0" border="0">
|
---|
724 | <tr>
|
---|
725 | <td class="md">
|
---|
726 | <table cellpadding="0" cellspacing="0" border="0">
|
---|
727 | <tr>
|
---|
728 | <td class="md" nowrap valign="top"> virtual void DOMWriter::setNewLine </td>
|
---|
729 | <td class="md" valign="top">( </td>
|
---|
730 | <td class="md" nowrap valign="top">const XMLCh *const </td>
|
---|
731 | <td class="mdname1" valign="top" nowrap> <em>newLine</em> </td>
|
---|
732 | <td class="md" valign="top">) </td>
|
---|
733 | <td class="md" nowrap><code> [pure virtual]</code></td>
|
---|
734 | </tr>
|
---|
735 |
|
---|
736 | </table>
|
---|
737 | </td>
|
---|
738 | </tr>
|
---|
739 | </table>
|
---|
740 | <table cellspacing=5 cellpadding=0 border=0>
|
---|
741 | <tr>
|
---|
742 | <td>
|
---|
743 |
|
---|
744 | </td>
|
---|
745 | <td>
|
---|
746 |
|
---|
747 | <p>
|
---|
748 | The end-of-line sequence of characters to be used in the XML being written out.
|
---|
749 | <p>
|
---|
750 | The only permitted values are these:
|
---|
751 | <dl compact>
|
---|
752 | <dt><code>null</code> <dd> Use a default end-of-line sequence. DOM implementations should choose the default to match the usual convention for text files in the environment being used. Implementations must choose a default sequence that matches one of those allowed by 2.11 "End-of-Line Handling". <dt>CR <dd>The carriage-return character (xD). <dt>CR-LF <dd> The carriage-return and line-feed characters (xD xA). <dt>LF <dd> The line-feed character (xA).
|
---|
753 | </dl>
|
---|
754 | <br>
|
---|
755 | The default value for this attribute is <code>null</code>.
|
---|
756 | <p>
|
---|
757 |
|
---|
758 | <p>
|
---|
759 | <b>"Experimental - subject to change"</b><dl compact><dt><b>
|
---|
760 | Parameters: </b><dd>
|
---|
761 | <table border=0 cellspacing=2 cellpadding=0>
|
---|
762 | <tr><td valign=top><em>newLine</em> </td><td>
|
---|
763 | The end-of-line sequence of characters to be used. </td></tr>
|
---|
764 | </table>
|
---|
765 | </dl><dl compact><dt><b>
|
---|
766 | See also: </b><dd>
|
---|
767 | <a class="el" href="classDOMWriter.html#z176_8">getNewLine</a> </dl><dl compact><dt><b>
|
---|
768 | Since: </b><dd>
|
---|
769 | DOM Level 3 </dl> </td>
|
---|
770 | </tr>
|
---|
771 | </table>
|
---|
772 | <a name="z176_11" doxytag="DOMWriter::writeNode"></a><p>
|
---|
773 | <table width="100%" cellpadding="2" cellspacing="0" border="0">
|
---|
774 | <tr>
|
---|
775 | <td class="md">
|
---|
776 | <table cellpadding="0" cellspacing="0" border="0">
|
---|
777 | <tr>
|
---|
778 | <td class="md" nowrap valign="top"> virtual bool DOMWriter::writeNode </td>
|
---|
779 | <td class="md" valign="top">( </td>
|
---|
780 | <td class="md" nowrap valign="top"><a class="el" href="classXMLFormatTarget.html">XMLFormatTarget</a> *const </td>
|
---|
781 | <td class="mdname" nowrap> <em>destination</em>, </td>
|
---|
782 | </tr>
|
---|
783 | <tr>
|
---|
784 | <td></td>
|
---|
785 | <td></td>
|
---|
786 | <td class="md" nowrap>const <a class="el" href="classDOMNode.html">DOMNode</a> & </td>
|
---|
787 | <td class="mdname" nowrap> <em>nodeToWrite</em></td>
|
---|
788 | </tr>
|
---|
789 | <tr>
|
---|
790 | <td></td>
|
---|
791 | <td class="md">) </td>
|
---|
792 | <td class="md" colspan="2"><code> [pure virtual]</code></td>
|
---|
793 | </tr>
|
---|
794 |
|
---|
795 | </table>
|
---|
796 | </td>
|
---|
797 | </tr>
|
---|
798 | </table>
|
---|
799 | <table cellspacing=5 cellpadding=0 border=0>
|
---|
800 | <tr>
|
---|
801 | <td>
|
---|
802 |
|
---|
803 | </td>
|
---|
804 | <td>
|
---|
805 |
|
---|
806 | <p>
|
---|
807 | Write out the specified node as described above in the description of <code>DOMWriter</code>.
|
---|
808 | <p>
|
---|
809 | 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.
|
---|
810 | <p>
|
---|
811 |
|
---|
812 | <p>
|
---|
813 | <b>"Experimental - subject to change"</b><dl compact><dt><b>
|
---|
814 | Parameters: </b><dd>
|
---|
815 | <table border=0 cellspacing=2 cellpadding=0>
|
---|
816 | <tr><td valign=top><em>destination</em> </td><td>
|
---|
817 | The destination for the data to be written. </td></tr>
|
---|
818 | <tr><td valign=top><em>nodeToWrite</em> </td><td>
|
---|
819 | The <code>Document</code> or <code>Entity</code> node to be written. For other node types, something sensible should be written, but the exact serialized form is not specified. </td></tr>
|
---|
820 | </table>
|
---|
821 | </dl><dl compact><dt><b>
|
---|
822 | Returns: </b><dd>
|
---|
823 | Returns <code>true</code> if <code>node</code> was successfully serialized and <code>false</code> in case a failure occured and the failure wasn't canceled by the error handler. </dl><dl compact><dt><b>
|
---|
824 | Exceptions: </b><dd>
|
---|
825 | <table border=0 cellspacing=2 cellpadding=0>
|
---|
826 | <tr><td valign=top><em>DOMSystemException</em> </td><td>
|
---|
827 | This exception will be raised in response to any sort of IO or system error that occurs while writing to the destination. It may wrap an underlying system exception. </td></tr>
|
---|
828 | </table>
|
---|
829 | </dl><dl compact><dt><b>
|
---|
830 | Since: </b><dd>
|
---|
831 | DOM Level 3 </dl> </td>
|
---|
832 | </tr>
|
---|
833 | </table>
|
---|
834 | <a name="z176_12" doxytag="DOMWriter::writeToString"></a><p>
|
---|
835 | <table width="100%" cellpadding="2" cellspacing="0" border="0">
|
---|
836 | <tr>
|
---|
837 | <td class="md">
|
---|
838 | <table cellpadding="0" cellspacing="0" border="0">
|
---|
839 | <tr>
|
---|
840 | <td class="md" nowrap valign="top"> virtual XMLCh* DOMWriter::writeToString </td>
|
---|
841 | <td class="md" valign="top">( </td>
|
---|
842 | <td class="md" nowrap valign="top">const <a class="el" href="classDOMNode.html">DOMNode</a> & </td>
|
---|
843 | <td class="mdname1" valign="top" nowrap> <em>nodeToWrite</em> </td>
|
---|
844 | <td class="md" valign="top">) </td>
|
---|
845 | <td class="md" nowrap><code> [pure virtual]</code></td>
|
---|
846 | </tr>
|
---|
847 |
|
---|
848 | </table>
|
---|
849 | </td>
|
---|
850 | </tr>
|
---|
851 | </table>
|
---|
852 | <table cellspacing=5 cellpadding=0 border=0>
|
---|
853 | <tr>
|
---|
854 | <td>
|
---|
855 |
|
---|
856 | </td>
|
---|
857 | <td>
|
---|
858 |
|
---|
859 | <p>
|
---|
860 | Serialize the specified node as described above in the description of <code>DOMWriter</code>.
|
---|
861 | <p>
|
---|
862 | 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.
|
---|
863 | <p>
|
---|
864 |
|
---|
865 | <p>
|
---|
866 | <b>"Experimental - subject to change"</b><dl compact><dt><b>
|
---|
867 | Parameters: </b><dd>
|
---|
868 | <table border=0 cellspacing=2 cellpadding=0>
|
---|
869 | <tr><td valign=top><em>nodeToWrite</em> </td><td>
|
---|
870 | The node to be written. </td></tr>
|
---|
871 | </table>
|
---|
872 | </dl><dl compact><dt><b>
|
---|
873 | Returns: </b><dd>
|
---|
874 | Returns the serialized data, or <code>null</code> 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 <a class="el" href="classDOMWriter.html#z176_12">writeToString</a>(). </dl><dl compact><dt><b>
|
---|
875 | Since: </b><dd>
|
---|
876 | DOM Level 3 </dl> </td>
|
---|
877 | </tr>
|
---|
878 | </table>
|
---|
879 | <hr>The documentation for this class was generated from the following file:<ul>
|
---|
880 | <li><a class="el" href="DOMWriter_8hpp-source.html">DOMWriter.hpp</a></ul>
|
---|
881 | </FONT></TD></TR></TABLE><BR>
|
---|
882 | </TD></TR></TABLE></TD></TR></TABLE><BR><TABLE border="0" cellpadding="0" cellspacing="0" width="620"><TR><TD bgcolor="#0086b2"><IMG height="1" src="images/dot.gif" width="1" alt=""></TD></TR><TR><TD align="center"><FONT color="#0086b2" size="-1"><I>
|
---|
883 | Copyright © 1994-2004 The Apache Software Foundation.
|
---|
884 | All Rights Reserved.
|
---|
885 | </I></FONT></TD></TR></TABLE></BODY></HTML>
|
---|