Debian Codegraph @

net/sf/saxon/dom/DocumentOverNodeInfo.java

raw symbols SCIP
1 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2 // Copyright (c) 2018 Saxonica Limited.
3 // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4 // If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 // This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
6 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
7
8 package net.sf.saxon.dom;
9
10 import net.sf.saxon.om.AxisInfo;
11 import net.sf.saxon.om.NodeInfo;
12 import net.sf.saxon.om.TreeInfo;
13 import net.sf.saxon.pattern.NodeKindTest;
14 import net.sf.saxon.tree.iter.AxisIterator;
15 import net.sf.saxon.type.Type;
16 import org.w3c.dom.*;
17
18 import java.util.ArrayList;
19 import java.util.List;
20
21 /**
22 * This class is an implementation of the DOM Document class that wraps a Saxon DocumentInfo
23 * representation of a document node.
24 */
25
26 public class DocumentOverNodeInfo extends NodeOverNodeInfo implements Document {
27
28 /**
29 * Get the Document Type Declaration (see <code>DocumentType</code> )
30 * associated with this document. For HTML documents as well as XML
31 * documents without a document type declaration this returns
32 * <code>null</code>. DOM method.
33 *
34 * @return null: The Saxon tree model does not include the document type
35 * information.
36 */
37
38 public DocumentType getDoctype() {
39 return null;
40 }
41
42 /**
43 * Get a <code>DOMImplementation</code> object that handles this document.
44 * A DOM application may use objects from multiple implementations.
45 * DOM method.
46 */
47
48 public DOMImplementation getImplementation() {
49 return new DOMImplementationImpl();
50 }
51
52 /**
53 * Creates an element of the type specified. DOM method: always fails,
54 * because the Saxon tree is not updateable.
55 */
56
57 public Element createElement(String tagName) throws DOMException {
58 disallowUpdate();
59 return null;
60 }
61
62 /**
63 * Creates an empty <code>DocumentFragment</code> object.
64 *
65 * @return A new <code>DocumentFragment</code> .
66 * DOM method: returns null, because the Saxon tree is not updateable.
67 */
68
69 public DocumentFragment createDocumentFragment() {
70 return null;
71 }
72
73 /**
74 * Create a <code>Text</code> node given the specified string.
75 * DOM method: returns null, because the Saxon tree is not updateable.
76 *
77 * @param data The data for the node.
78 * @return The new <code>Text</code> object.
79 */
80
81 public Text createTextNode(String data) {
82 return null;
83 }
84
85 /**
86 * Create a <code>Comment</code> node given the specified string.
87 * DOM method: returns null, because the Saxon tree is not updateable.
88 *
89 * @param data The data for the node.
90 * @return The new <code>Comment</code> object.
91 */
92 public Comment createComment(String data) {
93 return null;
94 }
95
96 /**
97 * Create a <code>CDATASection</code> node whose value is the specified
98 * string.
99 * DOM method: always fails, because the Saxon tree is not updateable.
100 *
101 * @param data The data for the <code>CDATASection</code> contents.
102 * @return The new <code>CDATASection</code> object.
103 * @throws UnsupportedOperationException always
104 */
105
106 public CDATASection createCDATASection(String data) throws UnsupportedOperationException {
107 disallowUpdate();
108 return null;
109 }
110
111 /**
112 * Create a <code>ProcessingInstruction</code> node given the specified
113 * name and data strings.
114 * DOM method: returns null, because the Saxon tree is not updateable.
115 *
116 * @param target The target part of the processing instruction.
117 * @param data The data for the node.
118 * @return The new <code>ProcessingInstruction</code> object.
119 * @throws UnsupportedOperationException always
120 */
121
122 public ProcessingInstruction createProcessingInstruction(String target, String data)
123 throws UnsupportedOperationException {
124 disallowUpdate();
125 return null;
126 }
127
128 /**
129 * Create an <code>Attr</code> of the given name.
130 * DOM method: always fails, because the Saxon tree is not updateable.
131 *
132 * @param name The name of the attribute.
133 * @return A new <code>Attr</code> object with the <code>nodeName</code>
134 * attribute set to <code>name</code> , and <code>localName</code> ,
135 * <code>prefix</code> , and <code>namespaceURI</code> set to
136 * <code>null</code> .
137 * @throws UnsupportedOperationException always
138 */
139
140 public Attr createAttribute(String name) throws UnsupportedOperationException {
141 disallowUpdate();
142 return null;
143 }
144
145 /**
146 * Create an <code>EntityReference</code> object.
147 * DOM method: returns null, because the Saxon tree is not updateable.
148 *
149 * @param name The name of the entity to reference.
150 * @return The new <code>EntityReference</code> object.
151 * @throws UnsupportedOperationException always
152 */
153
154 public EntityReference createEntityReference(String name) throws UnsupportedOperationException {
155 disallowUpdate();
156 return null;
157 }
158
159 /**
160 * Return a <code>NodeList</code> of all the <code>Elements</code> with
161 * a given tag name in the order in which they are encountered in a
162 * preorder traversal of the <code>Document</code> tree.
163 *
164 * @param tagname The name of the tag to match on. The special value "*"
165 * matches all tags.
166 * @return A new <code>NodeList</code> object containing all the matched
167 * <code>Elements</code> .
168 */
169
170 public NodeList getElementsByTagName(String tagname) {
171 return getElementsByTagName(node, tagname);
172 }
173
174 /**
175 * Get the outermost element of a document.
176 *
177 * @return the Element for the outermost element of the document. If the document is
178 * not well-formed, this returns the first element child of the root if there is one, otherwise
179 * null.
180 */
181
182 public Element getDocumentElement() {
183 NodeInfo root = node.getRoot();
184 if (root == null) {
185 return null;
186 }
187 AxisIterator children =
188 root.iterateAxis(AxisInfo.CHILD, NodeKindTest.ELEMENT);
189 return (Element) wrap(children.next());
190 }
191
192 protected static NodeList getElementsByTagName(NodeInfo node, String tagname) {
193 AxisIterator allElements = node.iterateAxis(AxisInfo.DESCENDANT);
194 List<Node> nodes = new ArrayList<>(100);
195 while (true) {
196 NodeInfo next = allElements.next();
197 if (next == null) {
198 break;
199 }
200 if (next.getNodeKind() == Type.ELEMENT) {
201 if (tagname.equals("*") || tagname.equals(next.getDisplayName())) {
202 nodes.add(NodeOverNodeInfo.wrap(next));
203 }
204 }
205 }
206 return new DOMNodeList(nodes);
207 }
208
209
210 /**
211 * Import a node from another document to this document.
212 * DOM method: always fails, because the Saxon tree is not updateable.
213 *
214 * @throws UnsupportedOperationException always
215 * @since DOM Level 2
216 */
217
218 public Node importNode(Node importedNode, boolean deep) throws UnsupportedOperationException {
219 disallowUpdate();
220 return null;
221 }
222
223 /**
224 * Create an element of the given qualified name and namespace URI.
225 * HTML-only DOM implementations do not need to implement this method.
226 * DOM method: always fails, because the Saxon tree is not updateable.
227 *
228 * @param namespaceURI The namespace URI of the element to create.
229 * @param qualifiedName The qualified name of the element type to
230 * instantiate.
231 * @return A new <code>Element</code> object
232 * @throws UnsupportedOperationException always
233 */
234
235 public Element createElementNS(String namespaceURI, String qualifiedName) throws UnsupportedOperationException {
236 disallowUpdate();
237 return null;
238 }
239
240 /**
241 * Create an attribute of the given qualified name and namespace URI.
242 * HTML-only DOM implementations do not need to implement this method.
243 * DOM method: returns null, because the Saxon tree is not updateable.
244 *
245 * @param namespaceURI The namespace URI of the attribute to create.
246 * @param qualifiedName The qualified name of the attribute to
247 * instantiate.
248 * @return A new <code>Attr</code> object.
249 * @throws UnsupportedOperationException always
250 */
251
252 public Attr createAttributeNS(String namespaceURI, String qualifiedName) throws UnsupportedOperationException {
253 disallowUpdate();
254 return null;
255 }
256
257 /**
258 * Return a <code>NodeList</code> of all the <code>Elements</code> with
259 * a given local name and namespace URI in the order in which they are
260 * encountered in a preorder traversal of the <code>Document</code> tree.
261 * DOM method.
262 *
263 * @param namespaceURI The namespace URI of the elements to match on.
264 * The special value "*" matches all namespaces. The value null matches
265 * elements not in any namespace
266 * @param localName The local name of the elements to match on. The
267 * special value "*" matches all local names.
268 * @return A new <code>NodeList</code> object containing all the matched
269 * <code>Elements</code> .
270 * @since DOM Level 2
271 */
272
273 public NodeList getElementsByTagNameNS(String namespaceURI, String localName) {
274 return getElementsByTagNameNS(node, namespaceURI, localName);
275 }
276
277 public static NodeList getElementsByTagNameNS(NodeInfo node, String namespaceURI, String localName) {
278 String ns = namespaceURI == null ? "" : namespaceURI;
279 AxisIterator allElements = node.iterateAxis(AxisInfo.DESCENDANT);
280 List<Node> nodes = new ArrayList<>(100);
281 while (true) {
282 NodeInfo next = allElements.next();
283 if (next == null) {
284 break;
285 }
286 if (next.getNodeKind() == Type.ELEMENT) {
287 if ((ns.equals("*") || ns.equals(next.getURI())) &&
288 (localName.equals("*") || localName.equals(next.getLocalPart()))) {
289 nodes.add(NodeOverNodeInfo.wrap(next));
290 }
291 }
292 }
293 return new DOMNodeList(nodes);
294 }
295
296 /**
297 * Return the <code>Element</code> whose <code>ID</code> is given by
298 * <code>elementId</code> . If no such element exists, returns
299 * <code>null</code> . Behavior is not defined if more than one element
300 * has this <code>ID</code> . The DOM implementation must have
301 * information that says which attributes are of type ID. Attributes with
302 * the name "ID" are not of type ID unless so defined. Implementations
303 * that do not know whether attributes are of type ID or not are expected
304 * to return <code>null</code> .
305 *
306 * @param elementId The unique <code>id</code> value for an element.
307 * @return The matching element, or null if there is none.
308 * @since DOM Level 2
309 */
310
311 public Element getElementById(String elementId) {
312 // Defined on Document node; but we support it on any node.
313 TreeInfo doc = node.getTreeInfo();
314 if (doc == null) {
315 return null;
316 }
317 return (Element) wrap(doc.selectID(elementId, false));
318 }
319
320 /**
321 * An attribute specifying the encoding used for this document at the time
322 * of the parsing. This is <code>null</code> when it is not known, such
323 * as when the <code>Document</code> was created in memory.
324 *
325 * @since DOM Level 3
326 */
327 public String getInputEncoding() {
328 return null;
329 }
330
331 /**
332 * An attribute specifying, as part of the
333 * <a href='http://www.w3.org/TR/2004/REC-xml-20040204#NT-XMLDecl'>XML declaration</a>,
334 * the encoding of this document. This is <code>null</code> when
335 * unspecified or when it is not known, such as when the
336 * <code>Document</code> was created in memory.
337 *
338 * @since DOM Level 3
339 */
340 public String getXmlEncoding() {
341 return null;
342 }
343
344 /**
345 * An attribute specifying, as part of the
346 * <a href='http://www.w3.org/TR/2004/REC-xml-20040204#NT-XMLDecl'>XML declaration</a>,
347 * whether this document is standalone. This is <code>false</code> when
348 * unspecified.
349 * <p ><b>Note:</b> No verification is done on the value when setting
350 * this attribute. Applications should use
351 * <code>Document.normalizeDocument()</code> with the "validate"
352 * parameter to verify if the value matches the <a href='http://www.w3.org/TR/2004/REC-xml-20040204#sec-rmd'>validity
353 * constraint for standalone document declaration</a> as defined in [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>].
354 *
355 * @since DOM Level 3
356 */
357 public boolean getXmlStandalone() {
358 return false;
359 }
360
361 /**
362 * An attribute specifying, as part of the <a href='http://www.w3.org/TR/2004/REC-xml-20040204#NT-XMLDecl'>XML declaration</a>, whether this document is standalone. This is <code>false</code> when
363 * unspecified.
364 * <p ><b>Note:</b> No verification is done on the value when setting
365 * this attribute. Applications should use
366 * <code>Document.normalizeDocument()</code> with the "validate"
367 * parameter to verify if the value matches the <a href='http://www.w3.org/TR/2004/REC-xml-20040204#sec-rmd'>validity
368 * constraint for standalone document declaration</a> as defined in [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>].
369 *
370 * @throws org.w3c.dom.DOMException NOT_SUPPORTED_ERR: Raised if this document does not support the
371 * "XML" feature.
372 * @since DOM Level 3
373 */
374 public void setXmlStandalone(boolean xmlStandalone) throws DOMException {
375 disallowUpdate();
376 }
377
378 /**
379 * An attribute specifying, as part of the <a href='http://www.w3.org/TR/2004/REC-xml-20040204#NT-XMLDecl'>XML declaration</a>, the version number of this document. If there is no declaration and if
380 * this document supports the "XML" feature, the value is
381 * <code>"1.0"</code>. If this document does not support the "XML"
382 * feature, the value is always <code>null</code>. Changing this
383 * attribute will affect methods that check for invalid characters in
384 * XML names. Application should invoke
385 * <code>Document.normalizeDocument()</code> in order to check for
386 * invalid characters in the <code>Node</code>s that are already part of
387 * this <code>Document</code>.
388 * <br> DOM applications may use the
389 * <code>DOMImplementation.hasFeature(feature, version)</code> method
390 * with parameter values "XMLVersion" and "1.0" (respectively) to
391 * determine if an implementation supports [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]. DOM
392 * applications may use the same method with parameter values
393 * "XMLVersion" and "1.1" (respectively) to determine if an
394 * implementation supports [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>]. In both
395 * cases, in order to support XML, an implementation must also support
396 * the "XML" feature defined in this specification. <code>Document</code>
397 * objects supporting a version of the "XMLVersion" feature must not
398 * raise a <code>NOT_SUPPORTED_ERR</code> exception for the same version
399 * number when using <code>Document.xmlVersion</code>.
400 *
401 * @since DOM Level 3
402 */
403 public String getXmlVersion() {
404 return "1.0";
405 }
406
407 /**
408 * An attribute specifying, as part of the <a href='http://www.w3.org/TR/2004/REC-xml-20040204#NT-XMLDecl'>XML declaration</a>, the version number of this document. If there is no declaration and if
409 * this document supports the "XML" feature, the value is
410 * <code>"1.0"</code>. If this document does not support the "XML"
411 * feature, the value is always <code>null</code>. Changing this
412 * attribute will affect methods that check for invalid characters in
413 * XML names. Application should invoke
414 * <code>Document.normalizeDocument()</code> in order to check for
415 * invalid characters in the <code>Node</code>s that are already part of
416 * this <code>Document</code>.
417 * <br> DOM applications may use the
418 * <code>DOMImplementation.hasFeature(feature, version)</code> method
419 * with parameter values "XMLVersion" and "1.0" (respectively) to
420 * determine if an implementation supports [<a href='http://www.w3.org/TR/2004/REC-xml-20040204'>XML 1.0</a>]. DOM
421 * applications may use the same method with parameter values
422 * "XMLVersion" and "1.1" (respectively) to determine if an
423 * implementation supports [<a href='http://www.w3.org/TR/2004/REC-xml11-20040204/'>XML 1.1</a>]. In both
424 * cases, in order to support XML, an implementation must also support
425 * the "XML" feature defined in this specification. <code>Document</code>
426 * objects supporting a version of the "XMLVersion" feature must not
427 * raise a <code>NOT_SUPPORTED_ERR</code> exception for the same version
428 * number when using <code>Document.xmlVersion</code>.
429 *
430 * @throws org.w3c.dom.DOMException NOT_SUPPORTED_ERR: Raised if the version is set to a value that is
431 * not supported by this <code>Document</code> or if this document
432 * does not support the "XML" feature.
433 * @since DOM Level 3
434 */
435 public void setXmlVersion(String xmlVersion) throws DOMException {
436 disallowUpdate();
437 }
438
439 /**
440 * An attribute specifying whether error checking is enforced or not. When
441 * set to <code>false</code>, the implementation is free to not test
442 * every possible error case normally defined on DOM operations, and not
443 * raise any <code>DOMException</code> on DOM operations or report
444 * errors while using <code>Document.normalizeDocument()</code>. In case
445 * of error, the behavior is undefined. This attribute is
446 * <code>true</code> by default.
447 *
448 * @since DOM Level 3
449 */
450 public boolean getStrictErrorChecking() {
451 return false;
452 }
453
454 /**
455 * An attribute specifying whether error checking is enforced or not. When
456 * set to <code>false</code>, the implementation is free to not test
457 * every possible error case normally defined on DOM operations, and not
458 * raise any <code>DOMException</code> on DOM operations or report
459 * errors while using <code>Document.normalizeDocument()</code>. In case
460 * of error, the behavior is undefined. This attribute is
461 * <code>true</code> by default.
462 *
463 * @since DOM Level 3
464 */
465 public void setStrictErrorChecking(boolean strictErrorChecking) {
466 //no-op
467 }
468
469 /**
470 * The location of the document or <code>null</code> if undefined or if
471 * the <code>Document</code> was created using
472 * <code>DOMImplementation.createDocument</code>. No lexical checking is
473 * performed when setting this attribute; this could result in a
474 * <code>null</code> value returned when using <code>Node.baseURI</code>
475 * .
476 * <br> Beware that when the <code>Document</code> supports the feature
477 * "HTML" [<a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>DOM Level 2 HTML</a>]
478 * , the href attribute of the HTML BASE element takes precedence over
479 * this attribute when computing <code>Node.baseURI</code>.
480 *
481 * @since DOM Level 3
482 */
483 public String getDocumentURI() {
484 return node.getSystemId();
485 }
486
487 /**
488 * The location of the document or <code>null</code> if undefined or if
489 * the <code>Document</code> was created using
490 * <code>DOMImplementation.createDocument</code>. No lexical checking is
491 * performed when setting this attribute; this could result in a
492 * <code>null</code> value returned when using <code>Node.baseURI</code>
493 * .
494 * <br> Beware that when the <code>Document</code> supports the feature
495 * "HTML" [<a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>DOM Level 2 HTML</a>]
496 * , the href attribute of the HTML BASE element takes precedence over
497 * this attribute when computing <code>Node.baseURI</code>.
498 *
499 * @since DOM Level 3
500 * @throws UnsupportedOperationException always
501 */
502 public void setDocumentURI(String documentURI) throws UnsupportedOperationException {
503 disallowUpdate();
504 }
505
506 /**
507 * Attempts to adopt a node from another document to this document. If
508 * supported, it changes the <code>ownerDocument</code> of the source
509 * node, its children, as well as the attached attribute nodes if there
510 * are any. If the source node has a parent it is first removed from the
511 * child list of its parent. This effectively allows moving a subtree
512 * from one document to another (unlike <code>importNode()</code> which
513 * create a copy of the source node instead of moving it). When it
514 * fails, applications should use <code>Document.importNode()</code>
515 * instead. Note that if the adopted node is already part of this
516 * document (i.e. the source and target document are the same), this
517 * method still has the effect of removing the source node from the
518 * child list of its parent, if any. The following list describes the
519 * specifics for each type of node.
520 * <dl>
521 * <dt>ATTRIBUTE_NODE</dt>
522 * <dd>The
523 * <code>ownerElement</code> attribute is set to <code>null</code> and
524 * the <code>specified</code> flag is set to <code>true</code> on the
525 * adopted <code>Attr</code>. The descendants of the source
526 * <code>Attr</code> are recursively adopted.</dd>
527 * <dt>DOCUMENT_FRAGMENT_NODE</dt>
528 * <dd>The
529 * descendants of the source node are recursively adopted.</dd>
530 * <dt>DOCUMENT_NODE</dt>
531 * <dd>
532 * <code>Document</code> nodes cannot be adopted.</dd>
533 * <dt>DOCUMENT_TYPE_NODE</dt>
534 * <dd>
535 * <code>DocumentType</code> nodes cannot be adopted.</dd>
536 * <dt>ELEMENT_NODE</dt>
537 * <dd><em>Specified</em> attribute nodes of the source element are adopted. Default attributes
538 * are discarded, though if the document being adopted into defines
539 * default attributes for this element name, those are assigned. The
540 * descendants of the source element are recursively adopted.</dd>
541 * <dt>ENTITY_NODE</dt>
542 * <dd>
543 * <code>Entity</code> nodes cannot be adopted.</dd>
544 * <dt>ENTITY_REFERENCE_NODE</dt>
545 * <dd>Only
546 * the <code>EntityReference</code> node itself is adopted, the
547 * descendants are discarded, since the source and destination documents
548 * might have defined the entity differently. If the document being
549 * imported into provides a definition for this entity name, its value
550 * is assigned.</dd>
551 * <dt>NOTATION_NODE</dt>
552 * <dd><code>Notation</code> nodes cannot be
553 * adopted.</dd>
554 * <dt>PROCESSING_INSTRUCTION_NODE, TEXT_NODE, CDATA_SECTION_NODE,
555 * COMMENT_NODE</dt>
556 * <dd>These nodes can all be adopted. No specifics.</dd>
557 * </dl>
558 * <p><b>Note:</b> Since it does not create new nodes unlike the
559 * <code>Document.importNode()</code> method, this method does not raise
560 * an <code>INVALID_CHARACTER_ERR</code> exception, and applications
561 * should use the <code>Document.normalizeDocument()</code> method to
562 * check if an imported name is not an XML name according to the XML
563 * version in use.</p>
564 *
565 * @param source The node to move into this document.
566 * @return The adopted node, or <code>null</code> if this operation
567 * fails, such as when the source node comes from a different
568 * implementation.
569 * @throws org.w3c.dom.DOMException NOT_SUPPORTED_ERR: Raised if the source node is of type
570 * <code>DOCUMENT</code>, <code>DOCUMENT_TYPE</code>.
571 * <br>NO_MODIFICATION_ALLOWED_ERR: Raised when the source node is
572 * readonly.
573 * @since DOM Level 3
574 * @throws UnsupportedOperationException always
575 */
576 public Node adoptNode(Node source) throws UnsupportedOperationException {
577 disallowUpdate();
578 return null;
579 }
580
581 /**
582 * The configuration used when <code>Document.normalizeDocument()</code>
583 * is invoked.
584 *
585 * @since DOM Level 3
586 */
587 public DOMConfiguration getDomConfig() {
588 return null;
589 }
590
591 /**
592 * This method acts as if the document was going through a save and load
593 * cycle, putting the document in a "normal" form. As a consequence,
594 * this method updates the replacement tree of
595 * <code>EntityReference</code> nodes and normalizes <code>Text</code>
596 * nodes, as defined in the method <code>Node.normalize()</code>.
597 * <br> Otherwise, the actual result depends on the features being set on
598 * the <code>Document.domConfig</code> object and governing what
599 * operations actually take place. Noticeably this method could also
600 * make the document namespace well-formed according to the algorithm
601 * described in , check the character normalization, remove the
602 * <code>CDATASection</code> nodes, etc. See
603 * <code>DOMConfiguration</code> for details.
604 * <pre>// Keep in the document
605 * the information defined // in the XML Information Set (Java example)
606 * DOMConfiguration docConfig = myDocument.getDomConfig();
607 * docConfig.setParameter("infoset", Boolean.TRUE);
608 * myDocument.normalizeDocument();</pre>
609 * <p>Mutation events, when supported, are generated to reflect the
610 * changes occurring on the document.</p>
611 * <p>If errors occur during the invocation of this method, such as an
612 * attempt to update a read-only node or a <code>Node.nodeName</code>
613 * contains an invalid character according to the XML version in use,
614 * errors or warnings (<code>DOMError.SEVERITY_ERROR</code> or
615 * <code>DOMError.SEVERITY_WARNING</code>) will be reported using the
616 * <code>DOMErrorHandler</code> object associated with the "error-handler
617 * " parameter. Note this method might also report fatal errors (
618 * <code>DOMError.SEVERITY_FATAL_ERROR</code>) if an implementation
619 * cannot recover from an error.</p>
620 *
621 * @since DOM Level 3
622 * @throws UnsupportedOperationException always
623 */
624 public void normalizeDocument() throws UnsupportedOperationException {
625 disallowUpdate();
626 }
627
628 /**
629 * Rename an existing node of type <code>ELEMENT_NODE</code> or
630 * <code>ATTRIBUTE_NODE</code>. Not supported in this implementation
631 *
632 * @param n The node to rename.
633 * @param namespaceURI The new namespace URI.
634 * @param qualifiedName The new qualified name.
635 * @return The renamed node. This is either the specified node or the new
636 * node that was created to replace the specified node.
637 * @throws UnsupportedOperationException always
638 */
639 /*@Nullable*/
640 public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws UnsupportedOperationException {
641 disallowUpdate();
642 return null;
643 }
644
645
646 }
647