282
283 /**
284 * The node immediately following this node. If there is no such node,
285 * this returns <code>null</code>.
286 */
287 public Node getNextSibling();
288
289 /**
290 * A <code>NamedNodeMap</code> containing the attributes of this node (if
291 * it is an <code>Element</code>) or <code>null</code> otherwise.
292 */
293 public NamedNodeMap getAttributes();
294
295 /**
296 * The <code>Document</code> object associated with this node. This is
297 * also the <code>Document</code> object used to create new nodes. When
298 * this node is a <code>Document</code> or a <code>DocumentType</code>
299 * which is not used with any <code>Document</code> yet, this is
300 * <code>null</code>.
301 *
302 * @since DOM Level 2
303 */
304 public Document getOwnerDocument();
305
306 /**
307 * Inserts the node <code>newChild</code> before the existing child node
308 * <code>refChild</code>. If <code>refChild</code> is <code>null</code>,
309 * insert <code>newChild</code> at the end of the list of children.
310 * <br>If <code>newChild</code> is a <code>DocumentFragment</code> object,
311 * all of its children are inserted, in the same order, before
312 * <code>refChild</code>. If the <code>newChild</code> is already in the
313 * tree, it is first removed.
314 * <p ><b>Note:</b> Inserting a node before itself is implementation
315 * dependent.
316 * @param newChild The node to insert.
317 * @param refChild The reference node, i.e., the node before which the
318 * new node must be inserted.
319 * @return The node being inserted.
320 * @exception DOMException
321 * HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
322 * allow children of the type of the <code>newChild</code> node, or if
323 * the node to insert is one of this node's ancestors or this node
324 * itself, or if this node is of type <code>Document</code> and the
325 * DOM application attempts to insert a second
326 * <code>DocumentType</code> or <code>Element</code> node.
327 * <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created
328 * from a different document than the one that created this node.
329 * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly or
330 * if the parent of the node being inserted is readonly.
331 * <br>NOT_FOUND_ERR: Raised if <code>refChild</code> is not a child of
332 * this node.
333 * <br>NOT_SUPPORTED_ERR: if this node is of type <code>Document</code>,
334 * this exception might be raised if the DOM implementation doesn't
335 * support the insertion of a <code>DocumentType</code> or
336 * <code>Element</code> node.
337 *
338 * @since DOM Level 3
339 */
340 public Node insertBefore(Node newChild,
341 Node refChild)
342 throws DOMException;
343
344 /**
345 * Replaces the child node <code>oldChild</code> with <code>newChild</code>
346 * in the list of children, and returns the <code>oldChild</code> node.
347 * <br>If <code>newChild</code> is a <code>DocumentFragment</code> object,
348 * <code>oldChild</code> is replaced by all of the
349 * <code>DocumentFragment</code> children, which are inserted in the
350 * same order. If the <code>newChild</code> is already in the tree, it
351 * is first removed.
352 * <p ><b>Note:</b> Replacing a node with itself is implementation
353 * dependent.
354 * @param newChild The new node to put in the child list.
355 * @param oldChild The node being replaced in the list.
356 * @return The node replaced.
357 * @exception DOMException
358 * HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
359 * allow children of the type of the <code>newChild</code> node, or if
360 * the node to put in is one of this node's ancestors or this node
361 * itself, or if this node is of type <code>Document</code> and the
362 * result of the replacement operation would add a second
363 * <code>DocumentType</code> or <code>Element</code> on the
364 * <code>Document</code> node.
365 * <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created
366 * from a different document than the one that created this node.
367 * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node or the parent of
368 * the new node is readonly.
369 * <br>NOT_FOUND_ERR: Raised if <code>oldChild</code> is not a child of
370 * this node.
371 * <br>NOT_SUPPORTED_ERR: if this node is of type <code>Document</code>,
372 * this exception might be raised if the DOM implementation doesn't
373 * support the replacement of the <code>DocumentType</code> child or
374 * <code>Element</code> child.
375 *
376 * @since DOM Level 3
377 */
378 public Node replaceChild(Node newChild,
379 Node oldChild)
380 throws DOMException;
381
382 /**
383 * Removes the child node indicated by <code>oldChild</code> from the list
384 * of children, and returns it.
385 * @param oldChild The node being removed.
386 * @return The node removed.
387 * @exception DOMException
388 * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
389 * <br>NOT_FOUND_ERR: Raised if <code>oldChild</code> is not a child of
390 * this node.
391 * <br>NOT_SUPPORTED_ERR: if this node is of type <code>Document</code>,
392 * this exception might be raised if the DOM implementation doesn't
393 * support the removal of the <code>DocumentType</code> child or the
394 * <code>Element</code> child.
395 *
396 * @since DOM Level 3
397 */
398 public Node removeChild(Node oldChild)
399 throws DOMException;
400
401 /**
402 * Adds the node <code>newChild</code> to the end of the list of children
403 * of this node. If the <code>newChild</code> is already in the tree, it
404 * is first removed.
405 * @param newChild The node to add.If it is a
406 * <code>DocumentFragment</code> object, the entire contents of the
407 * document fragment are moved into the child list of this node
408 * @return The node added.
409 * @exception DOMException
410 * HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
411 * allow children of the type of the <code>newChild</code> node, or if
412 * the node to append is one of this node's ancestors or this node
413 * itself, or if this node is of type <code>Document</code> and the
414 * DOM application attempts to append a second
415 * <code>DocumentType</code> or <code>Element</code> node.
416 * <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created
417 * from a different document than the one that created this node.
418 * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly or
419 * if the previous parent of the node being inserted is readonly.
420 * <br>NOT_SUPPORTED_ERR: if the <code>newChild</code> node is a child
421 * of the <code>Document</code> node, this exception might be raised
422 * if the DOM implementation doesn't support the removal of the
423 * <code>DocumentType</code> child or <code>Element</code> child.
424 *
425 * @since DOM Level 3
426 */
427 public Node appendChild(Node newChild)
428 throws DOMException;
429
430 /**
431 * Returns whether this node has any children.
432 * @return Returns <code>true</code> if this node has any children,
433 * <code>false</code> otherwise.
434 */
435 public boolean hasChildNodes();
436
437 /**
438 * Returns a duplicate of this node, i.e., serves as a generic copy
439 * constructor for nodes. The duplicate node has no parent (
440 * <code>parentNode</code> is <code>null</code>) and no user data. User
441 * data associated to the imported node is not carried over. However, if
442 * any <code>UserDataHandlers</code> has been specified along with the
443 * associated data these handlers will be called with the appropriate
444 * parameters before this method returns.
445 * <br>Cloning an <code>Element</code> copies all attributes and their
474 * Puts all <code>Text</code> nodes in the full depth of the sub-tree
475 * underneath this <code>Node</code>, including attribute nodes, into a
476 * "normal" form where only structure (e.g., elements, comments,
477 * processing instructions, CDATA sections, and entity references)
478 * separates <code>Text</code> nodes, i.e., there are neither adjacent
479 * <code>Text</code> nodes nor empty <code>Text</code> nodes. This can
480 * be used to ensure that the DOM view of a document is the same as if
481 * it were saved and re-loaded, and is useful when operations (such as
482 * XPointer [<a href='http://www.w3.org/TR/2003/REC-xptr-framework-20030325/'>XPointer</a>]
483 * lookups) that depend on a particular document tree structure are to
484 * be used. If the parameter "normalize-characters" of the
485 * <code>DOMConfiguration</code> object attached to the
486 * <code>Node.ownerDocument</code> is <code>true</code>, this method
487 * will also fully normalize the characters of the <code>Text</code>
488 * nodes.
489 * <p ><b>Note:</b> In cases where the document contains
490 * <code>CDATASections</code>, the normalize operation alone may not be
491 * sufficient, since XPointers do not differentiate between
492 * <code>Text</code> nodes and <code>CDATASection</code> nodes.
493 *
494 * @since DOM Level 3
495 */
496 public void normalize();
497
498 /**
499 * Tests whether the DOM implementation implements a specific feature and
500 * that feature is supported by this node, as specified in .
501 * @param feature The name of the feature to test.
502 * @param version This is the version number of the feature to test.
503 * @return Returns <code>true</code> if the specified feature is
504 * supported on this node, <code>false</code> otherwise.
505 *
506 * @since DOM Level 2
507 */
508 public boolean isSupported(String feature,
509 String version);
510
511 /**
512 * The namespace URI of this node, or <code>null</code> if it is
513 * unspecified (see ).
514 * <br>This is not a computed value that is the result of a namespace
515 * lookup based on an examination of the namespace declarations in
516 * scope. It is merely the namespace URI given at creation time.
517 * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and
518 * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1
519 * method, such as <code>Document.createElement()</code>, this is always
520 * <code>null</code>.
521 * <p ><b>Note:</b> Per the <em>Namespaces in XML</em> Specification [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
522 * an attribute does not inherit its namespace from the element it is
523 * attached to. If an attribute is not explicitly given a namespace, it
524 * simply has no namespace.
525 *
526 * @since DOM Level 2
527 */
528 public String getNamespaceURI();
529
530 /**
531 * The namespace prefix of this node, or <code>null</code> if it is
532 * unspecified. When it is defined to be <code>null</code>, setting it
533 * has no effect, including if the node is read-only.
534 * <br>Note that setting this attribute, when permitted, changes the
535 * <code>nodeName</code> attribute, which holds the qualified name, as
536 * well as the <code>tagName</code> and <code>name</code> attributes of
537 * the <code>Element</code> and <code>Attr</code> interfaces, when
538 * applicable.
539 * <br>Setting the prefix to <code>null</code> makes it unspecified,
540 * setting it to an empty string is implementation dependent.
541 * <br>Note also that changing the prefix of an attribute that is known to
542 * have a default value, does not make a new attribute with the default
543 * value and the original prefix appear, since the
544 * <code>namespaceURI</code> and <code>localName</code> do not change.
545 * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and
546 * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1
547 * method, such as <code>createElement</code> from the
548 * <code>Document</code> interface, this is always <code>null</code>.
549 *
550 * @since DOM Level 2
551 */
552 public String getPrefix();
553 /**
554 * The namespace prefix of this node, or <code>null</code> if it is
555 * unspecified. When it is defined to be <code>null</code>, setting it
556 * has no effect, including if the node is read-only.
557 * <br>Note that setting this attribute, when permitted, changes the
558 * <code>nodeName</code> attribute, which holds the qualified name, as
559 * well as the <code>tagName</code> and <code>name</code> attributes of
560 * the <code>Element</code> and <code>Attr</code> interfaces, when
561 * applicable.
562 * <br>Setting the prefix to <code>null</code> makes it unspecified,
563 * setting it to an empty string is implementation dependent.
564 * <br>Note also that changing the prefix of an attribute that is known to
565 * have a default value, does not make a new attribute with the default
566 * value and the original prefix appear, since the
567 * <code>namespaceURI</code> and <code>localName</code> do not change.
568 * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and
569 * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1
570 * method, such as <code>createElement</code> from the
571 * <code>Document</code> interface, this is always <code>null</code>.
572 * @exception DOMException
573 * INVALID_CHARACTER_ERR: Raised if the specified prefix contains an
574 * illegal character according to the XML version in use specified in
575 * the <code>Document.xmlVersion</code> attribute.
576 * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
577 * <br>NAMESPACE_ERR: Raised if the specified <code>prefix</code> is
578 * malformed per the Namespaces in XML specification, if the
579 * <code>namespaceURI</code> of this node is <code>null</code>, if the
580 * specified prefix is "xml" and the <code>namespaceURI</code> of this
581 * node is different from "<a href='http://www.w3.org/XML/1998/namespace'>
582 * http://www.w3.org/XML/1998/namespace</a>", if this node is an attribute and the specified prefix is "xmlns" and
583 * the <code>namespaceURI</code> of this node is different from "<a href='http://www.w3.org/2000/xmlns/'>http://www.w3.org/2000/xmlns/</a>", or if this node is an attribute and the <code>qualifiedName</code> of
584 * this node is "xmlns" [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
585 * .
586 *
587 * @since DOM Level 2
588 */
589 public void setPrefix(String prefix)
590 throws DOMException;
591
592 /**
593 * Returns the local part of the qualified name of this node.
594 * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and
595 * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1
596 * method, such as <code>Document.createElement()</code>, this is always
597 * <code>null</code>.
598 *
599 * @since DOM Level 2
600 */
601 public String getLocalName();
602
603 /**
604 * Returns whether this node (if it is an element) has any attributes.
605 * @return Returns <code>true</code> if this node has any attributes,
606 * <code>false</code> otherwise.
607 *
608 * @since DOM Level 2
609 */
610 public boolean hasAttributes();
611
612 /**
613 * The absolute base URI of this node or <code>null</code> if the
614 * implementation wasn't able to obtain an absolute URI. This value is
615 * computed as described in . However, when the <code>Document</code>
616 * supports the feature "HTML" [<a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>DOM Level 2 HTML</a>]
617 * , the base URI is computed using first the value of the href
618 * attribute of the HTML BASE element if any, and the value of the
619 * <code>documentURI</code> attribute from the <code>Document</code>
620 * interface otherwise.
621 *
622 * @since DOM Level 3
623 */
624 public String getBaseURI();
625
626 // DocumentPosition
627 /**
628 * The two nodes are disconnected. Order between disconnected nodes is
629 * always implementation-specific.
630 */
631 public static final short DOCUMENT_POSITION_DISCONNECTED = 0x01;
632 /**
633 * The second node precedes the reference node.
634 */
635 public static final short DOCUMENT_POSITION_PRECEDING = 0x02;
636 /**
637 * The node follows the reference node.
638 */
639 public static final short DOCUMENT_POSITION_FOLLOWING = 0x04;
640 /**
641 * The node contains the reference node. A node which contains is always
642 * preceding, too.
649 public static final short DOCUMENT_POSITION_CONTAINED_BY = 0x10;
650 /**
651 * The determination of preceding versus following is
652 * implementation-specific.
653 */
654 public static final short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;
655
656 /**
657 * Compares the reference node, i.e. the node on which this method is
658 * being called, with a node, i.e. the one passed as a parameter, with
659 * regard to their position in the document and according to the
660 * document order.
661 * @param other The node to compare against the reference node.
662 * @return Returns how the node is positioned relatively to the reference
663 * node.
664 * @exception DOMException
665 * NOT_SUPPORTED_ERR: when the compared nodes are from different DOM
666 * implementations that do not coordinate to return consistent
667 * implementation-specific results.
668 *
669 * @since DOM Level 3
670 */
671 public short compareDocumentPosition(Node other)
672 throws DOMException;
673
674 /**
675 * This attribute returns the text content of this node and its
676 * descendants. When it is defined to be <code>null</code>, setting it
677 * has no effect. On setting, any possible children this node may have
678 * are removed and, if it the new string is not empty or
679 * <code>null</code>, replaced by a single <code>Text</code> node
680 * containing the string this attribute is set to.
681 * <br> On getting, no serialization is performed, the returned string
682 * does not contain any markup. No whitespace normalization is performed
683 * and the returned string does not contain the white spaces in element
684 * content (see the attribute
685 * <code>Text.isElementContentWhitespace</code>). Similarly, on setting,
686 * no parsing is performed either, the input string is taken as pure
687 * textual content.
688 * <br>The string returned is made of the text content of this node
689 * depending on its type, as defined below:
700 * attribute value of every child node, excluding COMMENT_NODE and
701 * PROCESSING_INSTRUCTION_NODE nodes. This is the empty string if the
702 * node has no children.</td>
703 * </tr>
704 * <tr>
705 * <td valign='top' rowspan='1' colspan='1'>TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE,
706 * PROCESSING_INSTRUCTION_NODE</td>
707 * <td valign='top' rowspan='1' colspan='1'><code>nodeValue</code></td>
708 * </tr>
709 * <tr>
710 * <td valign='top' rowspan='1' colspan='1'>DOCUMENT_NODE,
711 * DOCUMENT_TYPE_NODE, NOTATION_NODE</td>
712 * <td valign='top' rowspan='1' colspan='1'><em>null</em></td>
713 * </tr>
714 * </table>
715 * @exception DOMException
716 * DOMSTRING_SIZE_ERR: Raised when it would return more characters than
717 * fit in a <code>DOMString</code> variable on the implementation
718 * platform.
719 *
720 * @since DOM Level 3
721 */
722 public String getTextContent()
723 throws DOMException;
724 /**
725 * This attribute returns the text content of this node and its
726 * descendants. When it is defined to be <code>null</code>, setting it
727 * has no effect. On setting, any possible children this node may have
728 * are removed and, if it the new string is not empty or
729 * <code>null</code>, replaced by a single <code>Text</code> node
730 * containing the string this attribute is set to.
731 * <br> On getting, no serialization is performed, the returned string
732 * does not contain any markup. No whitespace normalization is performed
733 * and the returned string does not contain the white spaces in element
734 * content (see the attribute
735 * <code>Text.isElementContentWhitespace</code>). Similarly, on setting,
736 * no parsing is performed either, the input string is taken as pure
737 * textual content.
738 * <br>The string returned is made of the text content of this node
739 * depending on its type, as defined below:
740 * <table border='1' cellpadding='3'>
748 * DOCUMENT_FRAGMENT_NODE</td>
749 * <td valign='top' rowspan='1' colspan='1'>concatenation of the <code>textContent</code>
750 * attribute value of every child node, excluding COMMENT_NODE and
751 * PROCESSING_INSTRUCTION_NODE nodes. This is the empty string if the
752 * node has no children.</td>
753 * </tr>
754 * <tr>
755 * <td valign='top' rowspan='1' colspan='1'>TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE,
756 * PROCESSING_INSTRUCTION_NODE</td>
757 * <td valign='top' rowspan='1' colspan='1'><code>nodeValue</code></td>
758 * </tr>
759 * <tr>
760 * <td valign='top' rowspan='1' colspan='1'>DOCUMENT_NODE,
761 * DOCUMENT_TYPE_NODE, NOTATION_NODE</td>
762 * <td valign='top' rowspan='1' colspan='1'><em>null</em></td>
763 * </tr>
764 * </table>
765 * @exception DOMException
766 * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
767 *
768 * @since DOM Level 3
769 */
770 public void setTextContent(String textContent)
771 throws DOMException;
772
773 /**
774 * Returns whether this node is the same node as the given one.
775 * <br>This method provides a way to determine whether two
776 * <code>Node</code> references returned by the implementation reference
777 * the same object. When two <code>Node</code> references are references
778 * to the same object, even if through a proxy, the references may be
779 * used completely interchangeably, such that all attributes have the
780 * same values and calling the same DOM method on either reference
781 * always has exactly the same effect.
782 * @param other The node to test against.
783 * @return Returns <code>true</code> if the nodes are the same,
784 * <code>false</code> otherwise.
785 *
786 * @since DOM Level 3
787 */
788 public boolean isSameNode(Node other);
789
790 /**
791 * Look up the prefix associated to the given namespace URI, starting from
792 * this node. The default namespace declarations are ignored by this
793 * method.
794 * <br>See for details on the algorithm used by this method.
795 * @param namespaceURI The namespace URI to look for.
796 * @return Returns an associated namespace prefix if found or
797 * <code>null</code> if none is found. If more than one prefix are
798 * associated to the namespace prefix, the returned namespace prefix
799 * is implementation dependent.
800 *
801 * @since DOM Level 3
802 */
803 public String lookupPrefix(String namespaceURI);
804
805 /**
806 * This method checks if the specified <code>namespaceURI</code> is the
807 * default namespace or not.
808 * @param namespaceURI The namespace URI to look for.
809 * @return Returns <code>true</code> if the specified
810 * <code>namespaceURI</code> is the default namespace,
811 * <code>false</code> otherwise.
812 *
813 * @since DOM Level 3
814 */
815 public boolean isDefaultNamespace(String namespaceURI);
816
817 /**
818 * Look up the namespace URI associated to the given prefix, starting from
819 * this node.
820 * <br>See for details on the algorithm used by this method.
821 * @param prefix The prefix to look for. If this parameter is
822 * <code>null</code>, the method will return the default namespace URI
823 * if any.
824 * @return Returns the associated namespace URI or <code>null</code> if
825 * none is found.
826 *
827 * @since DOM Level 3
828 */
829 public String lookupNamespaceURI(String prefix);
830
831 /**
832 * Tests whether two nodes are equal.
833 * <br>This method tests for equality of nodes, not sameness (i.e.,
834 * whether the two nodes are references to the same object) which can be
835 * tested with <code>Node.isSameNode()</code>. All nodes that are the
836 * same will also be equal, though the reverse may not be true.
837 * <br>Two nodes are equal if and only if the following conditions are
838 * satisfied:
839 * <ul>
840 * <li>The two nodes are of the same type.
841 * </li>
842 * <li>The following string
843 * attributes are equal: <code>nodeName</code>, <code>localName</code>,
844 * <code>namespaceURI</code>, <code>prefix</code>, <code>nodeValue</code>
845 * . This is: they are both <code>null</code>, or they have the same
846 * length and are character for character identical.
847 * </li>
873 * <code>NamedNodeMaps</code> are equal.
874 * </li>
875 * </ul>
876 * <br>On the other hand, the following do not affect equality: the
877 * <code>ownerDocument</code>, <code>baseURI</code>, and
878 * <code>parentNode</code> attributes, the <code>specified</code>
879 * attribute for <code>Attr</code> nodes, the <code>schemaTypeInfo</code>
880 * attribute for <code>Attr</code> and <code>Element</code> nodes, the
881 * <code>Text.isElementContentWhitespace</code> attribute for
882 * <code>Text</code> nodes, as well as any user data or event listeners
883 * registered on the nodes.
884 * <p ><b>Note:</b> As a general rule, anything not mentioned in the
885 * description above is not significant in consideration of equality
886 * checking. Note that future versions of this specification may take
887 * into account more attributes and implementations conform to this
888 * specification are expected to be updated accordingly.
889 * @param arg The node to compare equality with.
890 * @return Returns <code>true</code> if the nodes are equal,
891 * <code>false</code> otherwise.
892 *
893 * @since DOM Level 3
894 */
895 public boolean isEqualNode(Node arg);
896
897 /**
898 * This method returns a specialized object which implements the
899 * specialized APIs of the specified feature and version, as specified
900 * in . The specialized object may also be obtained by using
901 * binding-specific casting methods but is not necessarily expected to,
902 * as discussed in . This method also allow the implementation to
903 * provide specialized objects which do not support the <code>Node</code>
904 * interface.
905 * @param feature The name of the feature requested. Note that any plus
906 * sign "+" prepended to the name of the feature will be ignored since
907 * it is not significant in the context of this method.
908 * @param version This is the version number of the feature to test.
909 * @return Returns an object which implements the specialized APIs of
910 * the specified feature and version, if any, or <code>null</code> if
911 * there is no object which implements interfaces associated with that
912 * feature. If the <code>DOMObject</code> returned by this method
913 * implements the <code>Node</code> interface, it must delegate to the
914 * primary core <code>Node</code> and not return results inconsistent
915 * with the primary core <code>Node</code> such as attributes,
916 * childNodes, etc.
917 *
918 * @since DOM Level 3
919 */
920 public Object getFeature(String feature,
921 String version);
922
923 /**
924 * Associate an object to a key on this node. The object can later be
925 * retrieved from this node by calling <code>getUserData</code> with the
926 * same key.
927 * @param key The key to associate the object to.
928 * @param data The object to associate to the given key, or
929 * <code>null</code> to remove any existing association to that key.
930 * @param handler The handler to associate to that key, or
931 * <code>null</code>.
932 * @return Returns the <code>DOMUserData</code> previously associated to
933 * the given key on this node, or <code>null</code> if there was none.
934 *
935 * @since DOM Level 3
936 */
937 public Object setUserData(String key,
938 Object data,
939 UserDataHandler handler);
940
941 /**
942 * Retrieves the object associated to a key on a this node. The object
943 * must first have been set to this node by calling
944 * <code>setUserData</code> with the same key.
945 * @param key The key the object is associated to.
946 * @return Returns the <code>DOMUserData</code> associated to the given
947 * key on this node, or <code>null</code> if there was none.
948 *
949 * @since DOM Level 3
950 */
951 public Object getUserData(String key);
952
953 }
|
282
283 /**
284 * The node immediately following this node. If there is no such node,
285 * this returns <code>null</code>.
286 */
287 public Node getNextSibling();
288
289 /**
290 * A <code>NamedNodeMap</code> containing the attributes of this node (if
291 * it is an <code>Element</code>) or <code>null</code> otherwise.
292 */
293 public NamedNodeMap getAttributes();
294
295 /**
296 * The <code>Document</code> object associated with this node. This is
297 * also the <code>Document</code> object used to create new nodes. When
298 * this node is a <code>Document</code> or a <code>DocumentType</code>
299 * which is not used with any <code>Document</code> yet, this is
300 * <code>null</code>.
301 *
302 * @since 1.4, DOM Level 2
303 */
304 public Document getOwnerDocument();
305
306 /**
307 * Inserts the node <code>newChild</code> before the existing child node
308 * <code>refChild</code>. If <code>refChild</code> is <code>null</code>,
309 * insert <code>newChild</code> at the end of the list of children.
310 * <br>If <code>newChild</code> is a <code>DocumentFragment</code> object,
311 * all of its children are inserted, in the same order, before
312 * <code>refChild</code>. If the <code>newChild</code> is already in the
313 * tree, it is first removed.
314 * <p ><b>Note:</b> Inserting a node before itself is implementation
315 * dependent.
316 * @param newChild The node to insert.
317 * @param refChild The reference node, i.e., the node before which the
318 * new node must be inserted.
319 * @return The node being inserted.
320 * @exception DOMException
321 * HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
322 * allow children of the type of the <code>newChild</code> node, or if
323 * the node to insert is one of this node's ancestors or this node
324 * itself, or if this node is of type <code>Document</code> and the
325 * DOM application attempts to insert a second
326 * <code>DocumentType</code> or <code>Element</code> node.
327 * <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created
328 * from a different document than the one that created this node.
329 * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly or
330 * if the parent of the node being inserted is readonly.
331 * <br>NOT_FOUND_ERR: Raised if <code>refChild</code> is not a child of
332 * this node.
333 * <br>NOT_SUPPORTED_ERR: if this node is of type <code>Document</code>,
334 * this exception might be raised if the DOM implementation doesn't
335 * support the insertion of a <code>DocumentType</code> or
336 * <code>Element</code> node.
337 *
338 * @since 1.4, DOM Level 3
339 */
340 public Node insertBefore(Node newChild,
341 Node refChild)
342 throws DOMException;
343
344 /**
345 * Replaces the child node <code>oldChild</code> with <code>newChild</code>
346 * in the list of children, and returns the <code>oldChild</code> node.
347 * <br>If <code>newChild</code> is a <code>DocumentFragment</code> object,
348 * <code>oldChild</code> is replaced by all of the
349 * <code>DocumentFragment</code> children, which are inserted in the
350 * same order. If the <code>newChild</code> is already in the tree, it
351 * is first removed.
352 * <p ><b>Note:</b> Replacing a node with itself is implementation
353 * dependent.
354 * @param newChild The new node to put in the child list.
355 * @param oldChild The node being replaced in the list.
356 * @return The node replaced.
357 * @exception DOMException
358 * HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
359 * allow children of the type of the <code>newChild</code> node, or if
360 * the node to put in is one of this node's ancestors or this node
361 * itself, or if this node is of type <code>Document</code> and the
362 * result of the replacement operation would add a second
363 * <code>DocumentType</code> or <code>Element</code> on the
364 * <code>Document</code> node.
365 * <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created
366 * from a different document than the one that created this node.
367 * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node or the parent of
368 * the new node is readonly.
369 * <br>NOT_FOUND_ERR: Raised if <code>oldChild</code> is not a child of
370 * this node.
371 * <br>NOT_SUPPORTED_ERR: if this node is of type <code>Document</code>,
372 * this exception might be raised if the DOM implementation doesn't
373 * support the replacement of the <code>DocumentType</code> child or
374 * <code>Element</code> child.
375 *
376 * @since 1.4, DOM Level 3
377 */
378 public Node replaceChild(Node newChild,
379 Node oldChild)
380 throws DOMException;
381
382 /**
383 * Removes the child node indicated by <code>oldChild</code> from the list
384 * of children, and returns it.
385 * @param oldChild The node being removed.
386 * @return The node removed.
387 * @exception DOMException
388 * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
389 * <br>NOT_FOUND_ERR: Raised if <code>oldChild</code> is not a child of
390 * this node.
391 * <br>NOT_SUPPORTED_ERR: if this node is of type <code>Document</code>,
392 * this exception might be raised if the DOM implementation doesn't
393 * support the removal of the <code>DocumentType</code> child or the
394 * <code>Element</code> child.
395 *
396 * @since 1.4, DOM Level 3
397 */
398 public Node removeChild(Node oldChild)
399 throws DOMException;
400
401 /**
402 * Adds the node <code>newChild</code> to the end of the list of children
403 * of this node. If the <code>newChild</code> is already in the tree, it
404 * is first removed.
405 * @param newChild The node to add.If it is a
406 * <code>DocumentFragment</code> object, the entire contents of the
407 * document fragment are moved into the child list of this node
408 * @return The node added.
409 * @exception DOMException
410 * HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
411 * allow children of the type of the <code>newChild</code> node, or if
412 * the node to append is one of this node's ancestors or this node
413 * itself, or if this node is of type <code>Document</code> and the
414 * DOM application attempts to append a second
415 * <code>DocumentType</code> or <code>Element</code> node.
416 * <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created
417 * from a different document than the one that created this node.
418 * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly or
419 * if the previous parent of the node being inserted is readonly.
420 * <br>NOT_SUPPORTED_ERR: if the <code>newChild</code> node is a child
421 * of the <code>Document</code> node, this exception might be raised
422 * if the DOM implementation doesn't support the removal of the
423 * <code>DocumentType</code> child or <code>Element</code> child.
424 *
425 * @since 1.4, DOM Level 3
426 */
427 public Node appendChild(Node newChild)
428 throws DOMException;
429
430 /**
431 * Returns whether this node has any children.
432 * @return Returns <code>true</code> if this node has any children,
433 * <code>false</code> otherwise.
434 */
435 public boolean hasChildNodes();
436
437 /**
438 * Returns a duplicate of this node, i.e., serves as a generic copy
439 * constructor for nodes. The duplicate node has no parent (
440 * <code>parentNode</code> is <code>null</code>) and no user data. User
441 * data associated to the imported node is not carried over. However, if
442 * any <code>UserDataHandlers</code> has been specified along with the
443 * associated data these handlers will be called with the appropriate
444 * parameters before this method returns.
445 * <br>Cloning an <code>Element</code> copies all attributes and their
474 * Puts all <code>Text</code> nodes in the full depth of the sub-tree
475 * underneath this <code>Node</code>, including attribute nodes, into a
476 * "normal" form where only structure (e.g., elements, comments,
477 * processing instructions, CDATA sections, and entity references)
478 * separates <code>Text</code> nodes, i.e., there are neither adjacent
479 * <code>Text</code> nodes nor empty <code>Text</code> nodes. This can
480 * be used to ensure that the DOM view of a document is the same as if
481 * it were saved and re-loaded, and is useful when operations (such as
482 * XPointer [<a href='http://www.w3.org/TR/2003/REC-xptr-framework-20030325/'>XPointer</a>]
483 * lookups) that depend on a particular document tree structure are to
484 * be used. If the parameter "normalize-characters" of the
485 * <code>DOMConfiguration</code> object attached to the
486 * <code>Node.ownerDocument</code> is <code>true</code>, this method
487 * will also fully normalize the characters of the <code>Text</code>
488 * nodes.
489 * <p ><b>Note:</b> In cases where the document contains
490 * <code>CDATASections</code>, the normalize operation alone may not be
491 * sufficient, since XPointers do not differentiate between
492 * <code>Text</code> nodes and <code>CDATASection</code> nodes.
493 *
494 * @since 1.4, DOM Level 3
495 */
496 public void normalize();
497
498 /**
499 * Tests whether the DOM implementation implements a specific feature and
500 * that feature is supported by this node, as specified in .
501 * @param feature The name of the feature to test.
502 * @param version This is the version number of the feature to test.
503 * @return Returns <code>true</code> if the specified feature is
504 * supported on this node, <code>false</code> otherwise.
505 *
506 * @since 1.4, DOM Level 2
507 */
508 public boolean isSupported(String feature,
509 String version);
510
511 /**
512 * The namespace URI of this node, or <code>null</code> if it is
513 * unspecified (see ).
514 * <br>This is not a computed value that is the result of a namespace
515 * lookup based on an examination of the namespace declarations in
516 * scope. It is merely the namespace URI given at creation time.
517 * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and
518 * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1
519 * method, such as <code>Document.createElement()</code>, this is always
520 * <code>null</code>.
521 * <p ><b>Note:</b> Per the <em>Namespaces in XML</em> Specification [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
522 * an attribute does not inherit its namespace from the element it is
523 * attached to. If an attribute is not explicitly given a namespace, it
524 * simply has no namespace.
525 *
526 * @since 1.4, DOM Level 2
527 */
528 public String getNamespaceURI();
529
530 /**
531 * The namespace prefix of this node, or <code>null</code> if it is
532 * unspecified. When it is defined to be <code>null</code>, setting it
533 * has no effect, including if the node is read-only.
534 * <br>Note that setting this attribute, when permitted, changes the
535 * <code>nodeName</code> attribute, which holds the qualified name, as
536 * well as the <code>tagName</code> and <code>name</code> attributes of
537 * the <code>Element</code> and <code>Attr</code> interfaces, when
538 * applicable.
539 * <br>Setting the prefix to <code>null</code> makes it unspecified,
540 * setting it to an empty string is implementation dependent.
541 * <br>Note also that changing the prefix of an attribute that is known to
542 * have a default value, does not make a new attribute with the default
543 * value and the original prefix appear, since the
544 * <code>namespaceURI</code> and <code>localName</code> do not change.
545 * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and
546 * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1
547 * method, such as <code>createElement</code> from the
548 * <code>Document</code> interface, this is always <code>null</code>.
549 *
550 * @since 1.4, DOM Level 2
551 */
552 public String getPrefix();
553 /**
554 * The namespace prefix of this node, or <code>null</code> if it is
555 * unspecified. When it is defined to be <code>null</code>, setting it
556 * has no effect, including if the node is read-only.
557 * <br>Note that setting this attribute, when permitted, changes the
558 * <code>nodeName</code> attribute, which holds the qualified name, as
559 * well as the <code>tagName</code> and <code>name</code> attributes of
560 * the <code>Element</code> and <code>Attr</code> interfaces, when
561 * applicable.
562 * <br>Setting the prefix to <code>null</code> makes it unspecified,
563 * setting it to an empty string is implementation dependent.
564 * <br>Note also that changing the prefix of an attribute that is known to
565 * have a default value, does not make a new attribute with the default
566 * value and the original prefix appear, since the
567 * <code>namespaceURI</code> and <code>localName</code> do not change.
568 * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and
569 * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1
570 * method, such as <code>createElement</code> from the
571 * <code>Document</code> interface, this is always <code>null</code>.
572 * @exception DOMException
573 * INVALID_CHARACTER_ERR: Raised if the specified prefix contains an
574 * illegal character according to the XML version in use specified in
575 * the <code>Document.xmlVersion</code> attribute.
576 * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
577 * <br>NAMESPACE_ERR: Raised if the specified <code>prefix</code> is
578 * malformed per the Namespaces in XML specification, if the
579 * <code>namespaceURI</code> of this node is <code>null</code>, if the
580 * specified prefix is "xml" and the <code>namespaceURI</code> of this
581 * node is different from "<a href='http://www.w3.org/XML/1998/namespace'>
582 * http://www.w3.org/XML/1998/namespace</a>", if this node is an attribute and the specified prefix is "xmlns" and
583 * the <code>namespaceURI</code> of this node is different from "<a href='http://www.w3.org/2000/xmlns/'>http://www.w3.org/2000/xmlns/</a>", or if this node is an attribute and the <code>qualifiedName</code> of
584 * this node is "xmlns" [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
585 * .
586 *
587 * @since 1.4, DOM Level 2
588 */
589 public void setPrefix(String prefix)
590 throws DOMException;
591
592 /**
593 * Returns the local part of the qualified name of this node.
594 * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and
595 * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1
596 * method, such as <code>Document.createElement()</code>, this is always
597 * <code>null</code>.
598 *
599 * @since 1.4, DOM Level 2
600 */
601 public String getLocalName();
602
603 /**
604 * Returns whether this node (if it is an element) has any attributes.
605 * @return Returns <code>true</code> if this node has any attributes,
606 * <code>false</code> otherwise.
607 *
608 * @since 1.4, DOM Level 2
609 */
610 public boolean hasAttributes();
611
612 /**
613 * The absolute base URI of this node or <code>null</code> if the
614 * implementation wasn't able to obtain an absolute URI. This value is
615 * computed as described in . However, when the <code>Document</code>
616 * supports the feature "HTML" [<a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>DOM Level 2 HTML</a>]
617 * , the base URI is computed using first the value of the href
618 * attribute of the HTML BASE element if any, and the value of the
619 * <code>documentURI</code> attribute from the <code>Document</code>
620 * interface otherwise.
621 *
622 * @since 1.5, DOM Level 3
623 */
624 public String getBaseURI();
625
626 // DocumentPosition
627 /**
628 * The two nodes are disconnected. Order between disconnected nodes is
629 * always implementation-specific.
630 */
631 public static final short DOCUMENT_POSITION_DISCONNECTED = 0x01;
632 /**
633 * The second node precedes the reference node.
634 */
635 public static final short DOCUMENT_POSITION_PRECEDING = 0x02;
636 /**
637 * The node follows the reference node.
638 */
639 public static final short DOCUMENT_POSITION_FOLLOWING = 0x04;
640 /**
641 * The node contains the reference node. A node which contains is always
642 * preceding, too.
649 public static final short DOCUMENT_POSITION_CONTAINED_BY = 0x10;
650 /**
651 * The determination of preceding versus following is
652 * implementation-specific.
653 */
654 public static final short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20;
655
656 /**
657 * Compares the reference node, i.e. the node on which this method is
658 * being called, with a node, i.e. the one passed as a parameter, with
659 * regard to their position in the document and according to the
660 * document order.
661 * @param other The node to compare against the reference node.
662 * @return Returns how the node is positioned relatively to the reference
663 * node.
664 * @exception DOMException
665 * NOT_SUPPORTED_ERR: when the compared nodes are from different DOM
666 * implementations that do not coordinate to return consistent
667 * implementation-specific results.
668 *
669 * @since 1.5, DOM Level 3
670 */
671 public short compareDocumentPosition(Node other)
672 throws DOMException;
673
674 /**
675 * This attribute returns the text content of this node and its
676 * descendants. When it is defined to be <code>null</code>, setting it
677 * has no effect. On setting, any possible children this node may have
678 * are removed and, if it the new string is not empty or
679 * <code>null</code>, replaced by a single <code>Text</code> node
680 * containing the string this attribute is set to.
681 * <br> On getting, no serialization is performed, the returned string
682 * does not contain any markup. No whitespace normalization is performed
683 * and the returned string does not contain the white spaces in element
684 * content (see the attribute
685 * <code>Text.isElementContentWhitespace</code>). Similarly, on setting,
686 * no parsing is performed either, the input string is taken as pure
687 * textual content.
688 * <br>The string returned is made of the text content of this node
689 * depending on its type, as defined below:
700 * attribute value of every child node, excluding COMMENT_NODE and
701 * PROCESSING_INSTRUCTION_NODE nodes. This is the empty string if the
702 * node has no children.</td>
703 * </tr>
704 * <tr>
705 * <td valign='top' rowspan='1' colspan='1'>TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE,
706 * PROCESSING_INSTRUCTION_NODE</td>
707 * <td valign='top' rowspan='1' colspan='1'><code>nodeValue</code></td>
708 * </tr>
709 * <tr>
710 * <td valign='top' rowspan='1' colspan='1'>DOCUMENT_NODE,
711 * DOCUMENT_TYPE_NODE, NOTATION_NODE</td>
712 * <td valign='top' rowspan='1' colspan='1'><em>null</em></td>
713 * </tr>
714 * </table>
715 * @exception DOMException
716 * DOMSTRING_SIZE_ERR: Raised when it would return more characters than
717 * fit in a <code>DOMString</code> variable on the implementation
718 * platform.
719 *
720 * @since 1.5, DOM Level 3
721 */
722 public String getTextContent()
723 throws DOMException;
724 /**
725 * This attribute returns the text content of this node and its
726 * descendants. When it is defined to be <code>null</code>, setting it
727 * has no effect. On setting, any possible children this node may have
728 * are removed and, if it the new string is not empty or
729 * <code>null</code>, replaced by a single <code>Text</code> node
730 * containing the string this attribute is set to.
731 * <br> On getting, no serialization is performed, the returned string
732 * does not contain any markup. No whitespace normalization is performed
733 * and the returned string does not contain the white spaces in element
734 * content (see the attribute
735 * <code>Text.isElementContentWhitespace</code>). Similarly, on setting,
736 * no parsing is performed either, the input string is taken as pure
737 * textual content.
738 * <br>The string returned is made of the text content of this node
739 * depending on its type, as defined below:
740 * <table border='1' cellpadding='3'>
748 * DOCUMENT_FRAGMENT_NODE</td>
749 * <td valign='top' rowspan='1' colspan='1'>concatenation of the <code>textContent</code>
750 * attribute value of every child node, excluding COMMENT_NODE and
751 * PROCESSING_INSTRUCTION_NODE nodes. This is the empty string if the
752 * node has no children.</td>
753 * </tr>
754 * <tr>
755 * <td valign='top' rowspan='1' colspan='1'>TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE,
756 * PROCESSING_INSTRUCTION_NODE</td>
757 * <td valign='top' rowspan='1' colspan='1'><code>nodeValue</code></td>
758 * </tr>
759 * <tr>
760 * <td valign='top' rowspan='1' colspan='1'>DOCUMENT_NODE,
761 * DOCUMENT_TYPE_NODE, NOTATION_NODE</td>
762 * <td valign='top' rowspan='1' colspan='1'><em>null</em></td>
763 * </tr>
764 * </table>
765 * @exception DOMException
766 * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
767 *
768 * @since 1.5, DOM Level 3
769 */
770 public void setTextContent(String textContent)
771 throws DOMException;
772
773 /**
774 * Returns whether this node is the same node as the given one.
775 * <br>This method provides a way to determine whether two
776 * <code>Node</code> references returned by the implementation reference
777 * the same object. When two <code>Node</code> references are references
778 * to the same object, even if through a proxy, the references may be
779 * used completely interchangeably, such that all attributes have the
780 * same values and calling the same DOM method on either reference
781 * always has exactly the same effect.
782 * @param other The node to test against.
783 * @return Returns <code>true</code> if the nodes are the same,
784 * <code>false</code> otherwise.
785 *
786 * @since 1.5, DOM Level 3
787 */
788 public boolean isSameNode(Node other);
789
790 /**
791 * Look up the prefix associated to the given namespace URI, starting from
792 * this node. The default namespace declarations are ignored by this
793 * method.
794 * <br>See for details on the algorithm used by this method.
795 * @param namespaceURI The namespace URI to look for.
796 * @return Returns an associated namespace prefix if found or
797 * <code>null</code> if none is found. If more than one prefix are
798 * associated to the namespace prefix, the returned namespace prefix
799 * is implementation dependent.
800 *
801 * @since 1.5, DOM Level 3
802 */
803 public String lookupPrefix(String namespaceURI);
804
805 /**
806 * This method checks if the specified <code>namespaceURI</code> is the
807 * default namespace or not.
808 * @param namespaceURI The namespace URI to look for.
809 * @return Returns <code>true</code> if the specified
810 * <code>namespaceURI</code> is the default namespace,
811 * <code>false</code> otherwise.
812 *
813 * @since 1.5, DOM Level 3
814 */
815 public boolean isDefaultNamespace(String namespaceURI);
816
817 /**
818 * Look up the namespace URI associated to the given prefix, starting from
819 * this node.
820 * <br>See for details on the algorithm used by this method.
821 * @param prefix The prefix to look for. If this parameter is
822 * <code>null</code>, the method will return the default namespace URI
823 * if any.
824 * @return Returns the associated namespace URI or <code>null</code> if
825 * none is found.
826 *
827 * @since 1.5, DOM Level 3
828 */
829 public String lookupNamespaceURI(String prefix);
830
831 /**
832 * Tests whether two nodes are equal.
833 * <br>This method tests for equality of nodes, not sameness (i.e.,
834 * whether the two nodes are references to the same object) which can be
835 * tested with <code>Node.isSameNode()</code>. All nodes that are the
836 * same will also be equal, though the reverse may not be true.
837 * <br>Two nodes are equal if and only if the following conditions are
838 * satisfied:
839 * <ul>
840 * <li>The two nodes are of the same type.
841 * </li>
842 * <li>The following string
843 * attributes are equal: <code>nodeName</code>, <code>localName</code>,
844 * <code>namespaceURI</code>, <code>prefix</code>, <code>nodeValue</code>
845 * . This is: they are both <code>null</code>, or they have the same
846 * length and are character for character identical.
847 * </li>
873 * <code>NamedNodeMaps</code> are equal.
874 * </li>
875 * </ul>
876 * <br>On the other hand, the following do not affect equality: the
877 * <code>ownerDocument</code>, <code>baseURI</code>, and
878 * <code>parentNode</code> attributes, the <code>specified</code>
879 * attribute for <code>Attr</code> nodes, the <code>schemaTypeInfo</code>
880 * attribute for <code>Attr</code> and <code>Element</code> nodes, the
881 * <code>Text.isElementContentWhitespace</code> attribute for
882 * <code>Text</code> nodes, as well as any user data or event listeners
883 * registered on the nodes.
884 * <p ><b>Note:</b> As a general rule, anything not mentioned in the
885 * description above is not significant in consideration of equality
886 * checking. Note that future versions of this specification may take
887 * into account more attributes and implementations conform to this
888 * specification are expected to be updated accordingly.
889 * @param arg The node to compare equality with.
890 * @return Returns <code>true</code> if the nodes are equal,
891 * <code>false</code> otherwise.
892 *
893 * @since 1.5, DOM Level 3
894 */
895 public boolean isEqualNode(Node arg);
896
897 /**
898 * This method returns a specialized object which implements the
899 * specialized APIs of the specified feature and version, as specified
900 * in . The specialized object may also be obtained by using
901 * binding-specific casting methods but is not necessarily expected to,
902 * as discussed in . This method also allow the implementation to
903 * provide specialized objects which do not support the <code>Node</code>
904 * interface.
905 * @param feature The name of the feature requested. Note that any plus
906 * sign "+" prepended to the name of the feature will be ignored since
907 * it is not significant in the context of this method.
908 * @param version This is the version number of the feature to test.
909 * @return Returns an object which implements the specialized APIs of
910 * the specified feature and version, if any, or <code>null</code> if
911 * there is no object which implements interfaces associated with that
912 * feature. If the <code>DOMObject</code> returned by this method
913 * implements the <code>Node</code> interface, it must delegate to the
914 * primary core <code>Node</code> and not return results inconsistent
915 * with the primary core <code>Node</code> such as attributes,
916 * childNodes, etc.
917 *
918 * @since 1.5, DOM Level 3
919 */
920 public Object getFeature(String feature,
921 String version);
922
923 /**
924 * Associate an object to a key on this node. The object can later be
925 * retrieved from this node by calling <code>getUserData</code> with the
926 * same key.
927 * @param key The key to associate the object to.
928 * @param data The object to associate to the given key, or
929 * <code>null</code> to remove any existing association to that key.
930 * @param handler The handler to associate to that key, or
931 * <code>null</code>.
932 * @return Returns the <code>DOMUserData</code> previously associated to
933 * the given key on this node, or <code>null</code> if there was none.
934 *
935 * @since 1.5, DOM Level 3
936 */
937 public Object setUserData(String key,
938 Object data,
939 UserDataHandler handler);
940
941 /**
942 * Retrieves the object associated to a key on a this node. The object
943 * must first have been set to this node by calling
944 * <code>setUserData</code> with the same key.
945 * @param key The key the object is associated to.
946 * @return Returns the <code>DOMUserData</code> associated to the given
947 * key on this node, or <code>null</code> if there was none.
948 *
949 * @since 1.5, DOM Level 3
950 */
951 public Object getUserData(String key);
952
953 }
|