1. /*
  2. * Copyright (c) 2004 World Wide Web Consortium,
  3. *
  4. * (Massachusetts Institute of Technology, European Research Consortium for
  5. * Informatics and Mathematics, Keio University). All Rights Reserved. This
  6. * work is distributed under the W3C(r) Software License [1] in the hope that
  7. * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
  8. * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. *
  10. * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
  11. */
  12. package org.w3c.dom.ls;
  13. import org.w3c.dom.DOMConfiguration;
  14. import org.w3c.dom.Node;
  15. import org.w3c.dom.DOMException;
  16. /**
  17. * A <code>LSSerializer</code> provides an API for serializing (writing) a
  18. * DOM document out into XML. The XML data is written to a string or an
  19. * output stream. Any changes or fixups made during the serialization affect
  20. * only the serialized data. The <code>Document</code> object and its
  21. * children are never altered by the serialization operation.
  22. * <p> During serialization of XML data, namespace fixup is done as defined in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
  23. * , Appendix B. [<a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>DOM Level 2 Core</a>]
  24. * allows empty strings as a real namespace URI. If the
  25. * <code>namespaceURI</code> of a <code>Node</code> is empty string, the
  26. * serialization will treat them as <code>null</code>, ignoring the prefix
  27. * if any.
  28. * <p> <code>LSSerializer</code> accepts any node type for serialization. For
  29. * nodes of type <code>Document</code> or <code>Entity</code>, well-formed
  30. * XML will be created when possible (well-formedness is guaranteed if the
  31. * document or entity comes from a parse operation and is unchanged since it
  32. * was created). The serialized output for these node types is either as a
  33. * XML document or an External XML Entity, respectively, and is acceptable
  34. * input for an XML parser. For all other types of nodes the serialized form
  35. * is implementation dependent.
  36. * <p>Within a <code>Document</code>, <code>DocumentFragment</code>, or
  37. * <code>Entity</code> being serialized, <code>Nodes</code> are processed as
  38. * follows
  39. * <ul>
  40. * <li> <code>Document</code> nodes are written, including the XML
  41. * declaration (unless the parameter "xml-declaration" is set to
  42. * <code>false</code>) and a DTD subset, if one exists in the DOM. Writing a
  43. * <code>Document</code> node serializes the entire document.
  44. * </li>
  45. * <li>
  46. * <code>Entity</code> nodes, when written directly by
  47. * <code>LSSerializer.write</code>, outputs the entity expansion but no
  48. * namespace fixup is done. The resulting output will be valid as an
  49. * external entity.
  50. * </li>
  51. * <li> If the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-entities'>
  52. * entities</a>" is set to <code>true</code>, <code>EntityReference</code> nodes are
  53. * serialized as an entity reference of the form "
  54. * <code>&entityName;</code>" in the output. Child nodes (the expansion)
  55. * of the entity reference are ignored. If the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-entities'>
  56. * entities</a>" is set to <code>false</code>, only the children of the entity reference
  57. * are serialized. <code>EntityReference</code> nodes with no children (no
  58. * corresponding <code>Entity</code> node or the corresponding
  59. * <code>Entity</code> nodes have no children) are always serialized.
  60. * </li>
  61. * <li>
  62. * <code>CDATAsections</code> containing content characters that cannot be
  63. * represented in the specified output encoding are handled according to the
  64. * "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-split-cdata-sections'>
  65. * split-cdata-sections</a>" parameter. If the parameter is set to <code>true</code>,
  66. * <code>CDATAsections</code> are split, and the unrepresentable characters
  67. * are serialized as numeric character references in ordinary content. The
  68. * exact position and number of splits is not specified. If the parameter
  69. * is set to <code>false</code>, unrepresentable characters in a
  70. * <code>CDATAsection</code> are reported as
  71. * <code>"wf-invalid-character"</code> errors if the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-well-formed'>
  72. * well-formed</a>" is set to <code>true</code>. The error is not recoverable - there is no
  73. * mechanism for supplying alternative characters and continuing with the
  74. * serialization.
  75. * </li>
  76. * <li> <code>DocumentFragment</code> nodes are serialized by
  77. * serializing the children of the document fragment in the order they
  78. * appear in the document fragment.
  79. * </li>
  80. * <li> All other node types (Element, Text,
  81. * etc.) are serialized to their corresponding XML source form.
  82. * </li>
  83. * </ul>
  84. * <p ><b>Note:</b> The serialization of a <code>Node</code> does not always
  85. * generate a well-formed XML document, i.e. a <code>LSParser</code> might
  86. * throw fatal errors when parsing the resulting serialization.
  87. * <p> Within the character data of a document (outside of markup), any
  88. * characters that cannot be represented directly are replaced with
  89. * character references. Occurrences of '<' and '&' are replaced by
  90. * the predefined entities &lt; and &amp;. The other predefined
  91. * entities (&gt;, &apos;, and &quot;) might not be used, except
  92. * where needed (e.g. using &gt; in cases such as ']]>'). Any
  93. * characters that cannot be represented directly in the output character
  94. * encoding are serialized as numeric character references (and since
  95. * character encoding standards commonly use hexadecimal representations of
  96. * characters, using the hexadecimal representation when serializing
  97. * character references is encouraged).
  98. * <p> To allow attribute values to contain both single and double quotes, the
  99. * apostrophe or single-quote character (') may be represented as
  100. * "&apos;", and the double-quote character (") as "&quot;". New
  101. * line characters and other characters that cannot be represented directly
  102. * in attribute values in the output character encoding are serialized as a
  103. * numeric character reference.
  104. * <p> Within markup, but outside of attributes, any occurrence of a character
  105. * that cannot be represented in the output character encoding is reported
  106. * as a <code>DOMError</code> fatal error. An example would be serializing
  107. * the element <LaCa\u00f1ada/> with <code>encoding="us-ascii"</code>.
  108. * This will result with a generation of a <code>DOMError</code>
  109. * "wf-invalid-character-in-node-name" (as proposed in "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-well-formed'>
  110. * well-formed</a>").
  111. * <p> When requested by setting the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-normalize-characters'>
  112. * normalize-characters</a>" on <code>LSSerializer</code> to true, character normalization is
  113. * performed according to the definition of <a href='http://www.w3.org/TR/2004/REC-xml11-20040204/#dt-fullnorm'>fully
  114. * normalized</a> characters included in appendix E of [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>] on all
  115. * data to be serialized, both markup and character data. The character
  116. * normalization process affects only the data as it is being written; it
  117. * does not alter the DOM's view of the document after serialization has
  118. * completed.
  119. * <p> Implementations are required to support the encodings "UTF-8",
  120. * "UTF-16", "UTF-16BE", and "UTF-16LE" to guarantee that data is
  121. * serializable in all encodings that are required to be supported by all
  122. * XML parsers. When the encoding is UTF-8, whether or not a byte order mark
  123. * is serialized, or if the output is big-endian or little-endian, is
  124. * implementation dependent. When the encoding is UTF-16, whether or not the
  125. * output is big-endian or little-endian is implementation dependent, but a
  126. * Byte Order Mark must be generated for non-character outputs, such as
  127. * <code>LSOutput.byteStream</code> or <code>LSOutput.systemId</code>. If
  128. * the Byte Order Mark is not generated, a "byte-order-mark-needed" warning
  129. * is reported. When the encoding is UTF-16LE or UTF-16BE, the output is
  130. * big-endian (UTF-16BE) or little-endian (UTF-16LE) and the Byte Order Mark
  131. * is not be generated. In all cases, the encoding declaration, if
  132. * generated, will correspond to the encoding used during the serialization
  133. * (e.g. <code>encoding="UTF-16"</code> will appear if UTF-16 was
  134. * requested).
  135. * <p> Namespaces are fixed up during serialization, the serialization process
  136. * will verify that namespace declarations, namespace prefixes and the
  137. * namespace URI associated with elements and attributes are consistent. If
  138. * inconsistencies are found, the serialized form of the document will be
  139. * altered to remove them. The method used for doing the namespace fixup
  140. * while serializing a document is the algorithm defined in Appendix B.1,
  141. * "Namespace normalization", of [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
  142. * .
  143. * <p> While serializing a document, the parameter "discard-default-content"
  144. * controls whether or not non-specified data is serialized.
  145. * <p> While serializing, errors and warnings are reported to the application
  146. * through the error handler (<code>LSSerializer.domConfig</code>'s "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>
  147. * error-handler</a>" parameter). This specification does in no way try to define all possible
  148. * errors and warnings that can occur while serializing a DOM node, but some
  149. * common error and warning cases are defined. The types (
  150. * <code>DOMError.type</code>) of errors and warnings defined by this
  151. * specification are:
  152. * <dl>
  153. * <dt><code>"no-output-specified" [fatal]</code></dt>
  154. * <dd> Raised when
  155. * writing to a <code>LSOutput</code> if no output is specified in the
  156. * <code>LSOutput</code>. </dd>
  157. * <dt>
  158. * <code>"unbound-prefix-in-entity-reference" [fatal]</code> </dt>
  159. * <dd> Raised if the
  160. * configuration parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-namespaces'>
  161. * namespaces</a>" is set to <code>true</code> and an entity whose replacement text
  162. * contains unbound namespace prefixes is referenced in a location where
  163. * there are no bindings for the namespace prefixes. </dd>
  164. * <dt>
  165. * <code>"unsupported-encoding" [fatal]</code></dt>
  166. * <dd> Raised if an unsupported
  167. * encoding is encountered. </dd>
  168. * </dl>
  169. * <p> In addition to raising the defined errors and warnings, implementations
  170. * are expected to raise implementation specific errors and warnings for any
  171. * other error and warning cases such as IO errors (file not found,
  172. * permission denied,...) and so on.
  173. * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407'>Document Object Model (DOM) Level 3 Load
  174. and Save Specification</a>.
  175. */
  176. public interface LSSerializer {
  177. /**
  178. * The <code>DOMConfiguration</code> object used by the
  179. * <code>LSSerializer</code> when serializing a DOM node.
  180. * <br> In addition to the parameters recognized by the <a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMConfiguration'>
  181. * DOMConfiguration</a> interface defined in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
  182. * , the <code>DOMConfiguration</code> objects for
  183. * <code>LSSerializer</code> adds, or modifies, the following
  184. * parameters:
  185. * <dl>
  186. * <dt><code>"canonical-form"</code></dt>
  187. * <dd>
  188. * <dl>
  189. * <dt><code>true</code></dt>
  190. * <dd>[<em>optional</em>] Writes the document according to the rules specified in [<a href='http://www.w3.org/TR/2001/REC-xml-c14n-20010315'>Canonical XML</a>].
  191. * In addition to the behavior described in "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-canonical-form'>
  192. * canonical-form</a>" [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
  193. * , setting this parameter to <code>true</code> will set the parameters
  194. * "format-pretty-print", "discard-default-content", and "xml-declaration
  195. * ", to <code>false</code>. Setting one of those parameters to
  196. * <code>true</code> will set this parameter to <code>false</code>.
  197. * Serializing an XML 1.1 document when "canonical-form" is
  198. * <code>true</code> will generate a fatal error. </dd>
  199. * <dt><code>false</code></dt>
  200. * <dd>[<em>required</em>] (<em>default</em>) Do not canonicalize the output. </dd>
  201. * </dl></dd>
  202. * <dt><code>"discard-default-content"</code></dt>
  203. * <dd>
  204. * <dl>
  205. * <dt>
  206. * <code>true</code></dt>
  207. * <dd>[<em>required</em>] (<em>default</em>) Use the <code>Attr.specified</code> attribute to decide what attributes
  208. * should be discarded. Note that some implementations might use
  209. * whatever information available to the implementation (i.e. XML
  210. * schema, DTD, the <code>Attr.specified</code> attribute, and so on) to
  211. * determine what attributes and content to discard if this parameter is
  212. * set to <code>true</code>. </dd>
  213. * <dt><code>false</code></dt>
  214. * <dd>[<em>required</em>]Keep all attributes and all content.</dd>
  215. * </dl></dd>
  216. * <dt><code>"format-pretty-print"</code></dt>
  217. * <dd>
  218. * <dl>
  219. * <dt>
  220. * <code>true</code></dt>
  221. * <dd>[<em>optional</em>] Formatting the output by adding whitespace to produce a pretty-printed,
  222. * indented, human-readable form. The exact form of the transformations
  223. * is not specified by this specification. Pretty-printing changes the
  224. * content of the document and may affect the validity of the document,
  225. * validating implementations should preserve validity. </dd>
  226. * <dt>
  227. * <code>false</code></dt>
  228. * <dd>[<em>required</em>] (<em>default</em>) Don't pretty-print the result. </dd>
  229. * </dl></dd>
  230. * <dt>
  231. * <code>"ignore-unknown-character-denormalizations"</code> </dt>
  232. * <dd>
  233. * <dl>
  234. * <dt>
  235. * <code>true</code></dt>
  236. * <dd>[<em>required</em>] (<em>default</em>) If, while verifying full normalization when [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>] is
  237. * supported, a character is encountered for which the normalization
  238. * properties cannot be determined, then raise a
  239. * <code>"unknown-character-denormalization"</code> warning (instead of
  240. * raising an error, if this parameter is not set) and ignore any
  241. * possible denormalizations caused by these characters. </dd>
  242. * <dt>
  243. * <code>false</code></dt>
  244. * <dd>[<em>optional</em>] Report a fatal error if a character is encountered for which the
  245. * processor cannot determine the normalization properties. </dd>
  246. * </dl></dd>
  247. * <dt>
  248. * <code>"normalize-characters"</code></dt>
  249. * <dd> This parameter is equivalent to
  250. * the one defined by <code>DOMConfiguration</code> in [<a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>DOM Level 3 Core</a>]
  251. * . Unlike in the Core, the default value for this parameter is
  252. * <code>true</code>. While DOM implementations are not required to
  253. * support <a href='http://www.w3.org/TR/2004/REC-xml11-20040204/#dt-fullnorm'>fully
  254. * normalizing</a> the characters in the document according to appendix E of [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>], this
  255. * parameter must be activated by default if supported. </dd>
  256. * <dt>
  257. * <code>"xml-declaration"</code></dt>
  258. * <dd>
  259. * <dl>
  260. * <dt><code>true</code></dt>
  261. * <dd>[<em>required</em>] (<em>default</em>) If a <code>Document</code>, <code>Element</code>, or <code>Entity</code>
  262. * node is serialized, the XML declaration, or text declaration, should
  263. * be included. The version (<code>Document.xmlVersion</code> if the
  264. * document is a Level 3 document and the version is non-null, otherwise
  265. * use the value "1.0"), and the output encoding (see
  266. * <code>LSSerializer.write</code> for details on how to find the output
  267. * encoding) are specified in the serialized XML declaration. </dd>
  268. * <dt>
  269. * <code>false</code></dt>
  270. * <dd>[<em>required</em>] Do not serialize the XML and text declarations. Report a
  271. * <code>"xml-declaration-needed"</code> warning if this will cause
  272. * problems (i.e. the serialized data is of an XML version other than [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>], or an
  273. * encoding would be needed to be able to re-parse the serialized data). </dd>
  274. * </dl></dd>
  275. * </dl>
  276. */
  277. public DOMConfiguration getDomConfig();
  278. /**
  279. * The end-of-line sequence of characters to be used in the XML being
  280. * written out. Any string is supported, but XML treats only a certain
  281. * set of characters sequence as end-of-line (See section 2.11,
  282. * "End-of-Line Handling" in [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>], if the
  283. * serialized content is XML 1.0 or section 2.11, "End-of-Line Handling"
  284. * in [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>], if the
  285. * serialized content is XML 1.1). Using other character sequences than
  286. * the recommended ones can result in a document that is either not
  287. * serializable or not well-formed).
  288. * <br> On retrieval, the default value of this attribute is the
  289. * implementation specific default end-of-line sequence. DOM
  290. * implementations should choose the default to match the usual
  291. * convention for text files in the environment being used.
  292. * Implementations must choose a default sequence that matches one of
  293. * those allowed by XML 1.0 or XML 1.1, depending on the serialized
  294. * content. Setting this attribute to <code>null</code> will reset its
  295. * value to the default value.
  296. * <br>
  297. */
  298. public String getNewLine();
  299. /**
  300. * The end-of-line sequence of characters to be used in the XML being
  301. * written out. Any string is supported, but XML treats only a certain
  302. * set of characters sequence as end-of-line (See section 2.11,
  303. * "End-of-Line Handling" in [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>], if the
  304. * serialized content is XML 1.0 or section 2.11, "End-of-Line Handling"
  305. * in [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>], if the
  306. * serialized content is XML 1.1). Using other character sequences than
  307. * the recommended ones can result in a document that is either not
  308. * serializable or not well-formed).
  309. * <br> On retrieval, the default value of this attribute is the
  310. * implementation specific default end-of-line sequence. DOM
  311. * implementations should choose the default to match the usual
  312. * convention for text files in the environment being used.
  313. * Implementations must choose a default sequence that matches one of
  314. * those allowed by XML 1.0 or XML 1.1, depending on the serialized
  315. * content. Setting this attribute to <code>null</code> will reset its
  316. * value to the default value.
  317. * <br>
  318. */
  319. public void setNewLine(String newLine);
  320. /**
  321. * When the application provides a filter, the serializer will call out
  322. * to the filter before serializing each Node. The filter implementation
  323. * can choose to remove the node from the stream or to terminate the
  324. * serialization early.
  325. * <br> The filter is invoked after the operations requested by the
  326. * <code>DOMConfiguration</code> parameters have been applied. For
  327. * example, CDATA sections won't be passed to the filter if "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-cdata-sections'>
  328. * cdata-sections</a>" is set to <code>false</code>.
  329. */
  330. public LSSerializerFilter getFilter();
  331. /**
  332. * When the application provides a filter, the serializer will call out
  333. * to the filter before serializing each Node. The filter implementation
  334. * can choose to remove the node from the stream or to terminate the
  335. * serialization early.
  336. * <br> The filter is invoked after the operations requested by the
  337. * <code>DOMConfiguration</code> parameters have been applied. For
  338. * example, CDATA sections won't be passed to the filter if "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-cdata-sections'>
  339. * cdata-sections</a>" is set to <code>false</code>.
  340. */
  341. public void setFilter(LSSerializerFilter filter);
  342. /**
  343. * Serialize the specified node as described above in the general
  344. * description of the <code>LSSerializer</code> interface. The output is
  345. * written to the supplied <code>LSOutput</code>.
  346. * <br> When writing to a <code>LSOutput</code>, the encoding is found by
  347. * looking at the encoding information that is reachable through the
  348. * <code>LSOutput</code> and the item to be written (or its owner
  349. * document) in this order:
  350. * <ol>
  351. * <li> <code>LSOutput.encoding</code>,
  352. * </li>
  353. * <li>
  354. * <code>Document.inputEncoding</code>,
  355. * </li>
  356. * <li>
  357. * <code>Document.xmlEncoding</code>.
  358. * </li>
  359. * </ol>
  360. * <br> If no encoding is reachable through the above properties, a
  361. * default encoding of "UTF-8" will be used. If the specified encoding
  362. * is not supported an "unsupported-encoding" fatal error is raised.
  363. * <br> If no output is specified in the <code>LSOutput</code>, a
  364. * "no-output-specified" fatal error is raised.
  365. * <br> The implementation is responsible of associating the appropriate
  366. * media type with the serialized data.
  367. * <br> When writing to a HTTP URI, a HTTP PUT is performed. When writing
  368. * to other types of URIs, the mechanism for writing the data to the URI
  369. * is implementation dependent.
  370. * @param nodeArg The node to serialize.
  371. * @param destination The destination for the serialized DOM.
  372. * @return Returns <code>true</code> if <code>node</code> was
  373. * successfully serialized. Return <code>false</code> in case the
  374. * normal processing stopped but the implementation kept serializing
  375. * the document; the result of the serialization being implementation
  376. * dependent then.
  377. * @exception LSException
  378. * SERIALIZE_ERR: Raised if the <code>LSSerializer</code> was unable to
  379. * serialize the node. DOM applications should attach a
  380. * <code>DOMErrorHandler</code> using the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>
  381. * error-handler</a>" if they wish to get details on the error.
  382. */
  383. public boolean write(Node nodeArg,
  384. LSOutput destination)
  385. throws LSException;
  386. /**
  387. * A convenience method that acts as if <code>LSSerializer.write</code>
  388. * was called with a <code>LSOutput</code> with no encoding specified
  389. * and <code>LSOutput.systemId</code> set to the <code>uri</code>
  390. * argument.
  391. * @param nodeArg The node to serialize.
  392. * @param uri The URI to write to.
  393. * @return Returns <code>true</code> if <code>node</code> was
  394. * successfully serialized. Return <code>false</code> in case the
  395. * normal processing stopped but the implementation kept serializing
  396. * the document; the result of the serialization being implementation
  397. * dependent then.
  398. * @exception LSException
  399. * SERIALIZE_ERR: Raised if the <code>LSSerializer</code> was unable to
  400. * serialize the node. DOM applications should attach a
  401. * <code>DOMErrorHandler</code> using the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>
  402. * error-handler</a>" if they wish to get details on the error.
  403. */
  404. public boolean writeToURI(Node nodeArg,
  405. String uri)
  406. throws LSException;
  407. /**
  408. * Serialize the specified node as described above in the general
  409. * description of the <code>LSSerializer</code> interface. The output is
  410. * written to a <code>DOMString</code> that is returned to the caller.
  411. * The encoding used is the encoding of the <code>DOMString</code> type,
  412. * i.e. UTF-16. Note that no Byte Order Mark is generated in a
  413. * <code>DOMString</code> object.
  414. * @param nodeArg The node to serialize.
  415. * @return Returns the serialized data.
  416. * @exception DOMException
  417. * DOMSTRING_SIZE_ERR: Raised if the resulting string is too long to
  418. * fit in a <code>DOMString</code>.
  419. * @exception LSException
  420. * SERIALIZE_ERR: Raised if the <code>LSSerializer</code> was unable to
  421. * serialize the node. DOM applications should attach a
  422. * <code>DOMErrorHandler</code> using the parameter "<a href='http://www.w3.org/TR/DOM-Level-3-Core/core.html#parameter-error-handler'>
  423. * error-handler</a>" if they wish to get details on the error.
  424. */
  425. public String writeToString(Node nodeArg)
  426. throws DOMException, LSException;
  427. }