1adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project/* 2320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * Copyright (c) 2004 World Wide Web Consortium, 3320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * 4320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * (Massachusetts Institute of Technology, European Research Consortium for 5320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * Informatics and Mathematics, Keio University). All Rights Reserved. This 6320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * work is distributed under the W3C(r) Software License [1] in the hope that 7320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * it will be useful, but WITHOUT ANY WARRANTY; without even the implied 8320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 9320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * 10320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 11adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 12adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 13adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Projectpackage org.w3c.dom; 14adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 15adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project/** 16f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * The <code>Node</code> interface is the primary datatype for the entire 17f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * Document Object Model. It represents a single node in the document tree. 18f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * While all objects implementing the <code>Node</code> interface expose 19f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * methods for dealing with children, not all objects implementing the 20f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>Node</code> interface may have children. For example, 21f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>Text</code> nodes may not have children, and adding children to 22adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * such nodes results in a <code>DOMException</code> being raised. 23f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <p>The attributes <code>nodeName</code>, <code>nodeValue</code> and 24f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>attributes</code> are included as a mechanism to get at node 25f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * information without casting down to the specific derived interface. In 26f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * cases where there is no obvious mapping of these attributes for a 27f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * specific <code>nodeType</code> (e.g., <code>nodeValue</code> for an 28adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * <code>Element</code> or <code>attributes</code> for a <code>Comment</code> 29f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * ), this returns <code>null</code>. Note that the specialized interfaces 30f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * may contain additional and more convenient mechanisms to get and set the 31adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * relevant information. 32f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <p>The values of <code>nodeName</code>, 33f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>nodeValue</code>, and <code>attributes</code> vary according to the 34f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * node type as follows: 35320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <table border='1' cellpadding='3'> 36320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <tr> 37320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <th>Interface</th> 38320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <th>nodeName</th> 39320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <th>nodeValue</th> 40320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <th>attributes</th> 41320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </tr> 42320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <tr> 43320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'> 44320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>Attr</code></td> 45320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'>same as <code>Attr.name</code></td> 46f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <td valign='top' rowspan='1' colspan='1'>same as 47320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>Attr.value</code></td> 48320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'><code>null</code></td> 49320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </tr> 50320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <tr> 51320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'><code>CDATASection</code></td> 52320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'> 53320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>"#cdata-section"</code></td> 54f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <td valign='top' rowspan='1' colspan='1'>same as <code>CharacterData.data</code>, the 55320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * content of the CDATA Section</td> 56320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'><code>null</code></td> 57320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </tr> 58320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <tr> 59320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'><code>Comment</code></td> 60320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'> 61320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>"#comment"</code></td> 62f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <td valign='top' rowspan='1' colspan='1'>same as <code>CharacterData.data</code>, the 63320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * content of the comment</td> 64320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'><code>null</code></td> 65320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </tr> 66320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <tr> 67320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'><code>Document</code></td> 68320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'> 69320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>"#document"</code></td> 70320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'><code>null</code></td> 71320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'><code>null</code></td> 72320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </tr> 73320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <tr> 74320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'> 75320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>DocumentFragment</code></td> 76320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'><code>"#document-fragment"</code></td> 77320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'> 78320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>null</code></td> 79320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'><code>null</code></td> 80320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </tr> 81320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <tr> 82320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'><code>DocumentType</code></td> 83f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <td valign='top' rowspan='1' colspan='1'>same as 84320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>DocumentType.name</code></td> 85320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'><code>null</code></td> 86320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'><code>null</code></td> 87320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </tr> 88320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <tr> 89320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'> 90320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>Element</code></td> 91320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'>same as <code>Element.tagName</code></td> 92320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'><code>null</code></td> 93320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'> 94320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>NamedNodeMap</code></td> 95320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </tr> 96320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <tr> 97320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'><code>Entity</code></td> 98320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'>entity name</td> 99320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'><code>null</code></td> 100320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'> 101320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>null</code></td> 102320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </tr> 103320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <tr> 104320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'><code>EntityReference</code></td> 105320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'>name of entity referenced</td> 106320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'> 107320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>null</code></td> 108320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'><code>null</code></td> 109320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </tr> 110320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <tr> 111320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'><code>Notation</code></td> 112320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'>notation name</td> 113320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'> 114320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>null</code></td> 115320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'><code>null</code></td> 116320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </tr> 117320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <tr> 118320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'><code>ProcessingInstruction</code></td> 119f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <td valign='top' rowspan='1' colspan='1'>same 120320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * as <code>ProcessingInstruction.target</code></td> 121f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <td valign='top' rowspan='1' colspan='1'>same as 122320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>ProcessingInstruction.data</code></td> 123320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'><code>null</code></td> 124320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </tr> 125320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <tr> 126320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'><code>Text</code></td> 127320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'> 128320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>"#text"</code></td> 129f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <td valign='top' rowspan='1' colspan='1'>same as <code>CharacterData.data</code>, the content 130320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * of the text node</td> 131320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'><code>null</code></td> 132320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </tr> 133f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * </table> 134320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407'>Document Object Model (DOM) Level 3 Core Specification</a>. 135adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 136adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Projectpublic interface Node { 137adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project // NodeType 138adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 139adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * The node is an <code>Element</code>. 140adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 141adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public static final short ELEMENT_NODE = 1; 142adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 143adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * The node is an <code>Attr</code>. 144adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 145adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public static final short ATTRIBUTE_NODE = 2; 146adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 147adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * The node is a <code>Text</code> node. 148adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 149adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public static final short TEXT_NODE = 3; 150adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 151adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * The node is a <code>CDATASection</code>. 152adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 153adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public static final short CDATA_SECTION_NODE = 4; 154adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 155adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * The node is an <code>EntityReference</code>. 156adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 157adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public static final short ENTITY_REFERENCE_NODE = 5; 158adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 159adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * The node is an <code>Entity</code>. 160adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 161adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public static final short ENTITY_NODE = 6; 162adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 163adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * The node is a <code>ProcessingInstruction</code>. 164adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 165adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public static final short PROCESSING_INSTRUCTION_NODE = 7; 166adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 167adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * The node is a <code>Comment</code>. 168adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 169adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public static final short COMMENT_NODE = 8; 170adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 171adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * The node is a <code>Document</code>. 172adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 173adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public static final short DOCUMENT_NODE = 9; 174adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 175adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * The node is a <code>DocumentType</code>. 176adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 177adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public static final short DOCUMENT_TYPE_NODE = 10; 178adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 179adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * The node is a <code>DocumentFragment</code>. 180adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 181adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public static final short DOCUMENT_FRAGMENT_NODE = 11; 182adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 183adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * The node is a <code>Notation</code>. 184adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 185adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public static final short NOTATION_NODE = 12; 186adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 187adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 188320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * The name of this node, depending on its type; see the table above. 189adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 190adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public String getNodeName(); 191adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 192adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 193f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * The value of this node, depending on its type; see the table above. 194f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * When it is defined to be <code>null</code>, setting it has no effect, 195320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * including if the node is read-only. 196adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @exception DOMException 197f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * DOMSTRING_SIZE_ERR: Raised when it would return more characters than 198f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * fit in a <code>DOMString</code> variable on the implementation 199adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * platform. 200adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 201adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public String getNodeValue() 202320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson throws DOMException; 203adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 204f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * The value of this node, depending on its type; see the table above. 205f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * When it is defined to be <code>null</code>, setting it has no effect, 206320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * including if the node is read-only. 207adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @exception DOMException 208f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly and if 209320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * it is not defined to be <code>null</code>. 210adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 211adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public void setNodeValue(String nodeValue) 212320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson throws DOMException; 213adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 214adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 215adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * A code representing the type of the underlying object, as defined above. 216adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 217adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public short getNodeType(); 218adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 219adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 220f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * The parent of this node. All nodes, except <code>Attr</code>, 221f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>Document</code>, <code>DocumentFragment</code>, 222f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>Entity</code>, and <code>Notation</code> may have a parent. 223f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * However, if a node has just been created and not yet added to the 224f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * tree, or if it has been removed from the tree, this is 225f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>null</code>. 226adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 227adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public Node getParentNode(); 228adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 229adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 230f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * A <code>NodeList</code> that contains all children of this node. If 231f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * there are no children, this is a <code>NodeList</code> containing no 232adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * nodes. 233adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 234adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public NodeList getChildNodes(); 235adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 236adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 237f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * The first child of this node. If there is no such node, this returns 238adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * <code>null</code>. 239adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 240adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public Node getFirstChild(); 241adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 242adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 243f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * The last child of this node. If there is no such node, this returns 244adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * <code>null</code>. 245adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 246adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public Node getLastChild(); 247adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 248adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 249f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * The node immediately preceding this node. If there is no such node, 250adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * this returns <code>null</code>. 251adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 252adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public Node getPreviousSibling(); 253adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 254adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 255f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * The node immediately following this node. If there is no such node, 256adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * this returns <code>null</code>. 257adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 258adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public Node getNextSibling(); 259adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 260adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 261f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * A <code>NamedNodeMap</code> containing the attributes of this node (if 262320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * it is an <code>Element</code>) or <code>null</code> otherwise. 263adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 264adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public NamedNodeMap getAttributes(); 265adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 266adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 267f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * The <code>Document</code> object associated with this node. This is 268f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * also the <code>Document</code> object used to create new nodes. When 269f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * this node is a <code>Document</code> or a <code>DocumentType</code> 270f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * which is not used with any <code>Document</code> yet, this is 271adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * <code>null</code>. 272adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @version DOM Level 2 273adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 274adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public Document getOwnerDocument(); 275adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 276adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 277f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * Inserts the node <code>newChild</code> before the existing child node 278f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>refChild</code>. If <code>refChild</code> is <code>null</code>, 279adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * insert <code>newChild</code> at the end of the list of children. 280f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>If <code>newChild</code> is a <code>DocumentFragment</code> object, 281f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * all of its children are inserted, in the same order, before 282f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>refChild</code>. If the <code>newChild</code> is already in the 283adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * tree, it is first removed. 284f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <p ><b>Note:</b> Inserting a node before itself is implementation 285f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * dependent. 286adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @param newChild The node to insert. 287f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @param refChild The reference node, i.e., the node before which the 288320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * new node must be inserted. 289adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @return The node being inserted. 290adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @exception DOMException 291f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not 292f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * allow children of the type of the <code>newChild</code> node, or if 293f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * the node to insert is one of this node's ancestors or this node 294f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * itself, or if this node is of type <code>Document</code> and the 295f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * DOM application attempts to insert a second 296320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>DocumentType</code> or <code>Element</code> node. 297f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created 298adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * from a different document than the one that created this node. 299f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly or 300adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * if the parent of the node being inserted is readonly. 301f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>NOT_FOUND_ERR: Raised if <code>refChild</code> is not a child of 302adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * this node. 303f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>NOT_SUPPORTED_ERR: if this node is of type <code>Document</code>, 304f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * this exception might be raised if the DOM implementation doesn't 305f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * support the insertion of a <code>DocumentType</code> or 306320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>Element</code> node. 307320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @version DOM Level 3 308adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 309f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes public Node insertBefore(Node newChild, 310adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project Node refChild) 311adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project throws DOMException; 312adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 313adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 314adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * Replaces the child node <code>oldChild</code> with <code>newChild</code> 315adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * in the list of children, and returns the <code>oldChild</code> node. 316f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>If <code>newChild</code> is a <code>DocumentFragment</code> object, 317f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>oldChild</code> is replaced by all of the 318f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>DocumentFragment</code> children, which are inserted in the 319f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * same order. If the <code>newChild</code> is already in the tree, it 320adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * is first removed. 321f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <p ><b>Note:</b> Replacing a node with itself is implementation 322f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * dependent. 323adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @param newChild The new node to put in the child list. 324adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @param oldChild The node being replaced in the list. 325adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @return The node replaced. 326adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @exception DOMException 327f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not 328f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * allow children of the type of the <code>newChild</code> node, or if 329f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * the node to put in is one of this node's ancestors or this node 330f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * itself, or if this node is of type <code>Document</code> and the 331f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * result of the replacement operation would add a second 332f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>DocumentType</code> or <code>Element</code> on the 333320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>Document</code> node. 334f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created 335adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * from a different document than the one that created this node. 336f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node or the parent of 337adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * the new node is readonly. 338f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>NOT_FOUND_ERR: Raised if <code>oldChild</code> is not a child of 339adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * this node. 340f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>NOT_SUPPORTED_ERR: if this node is of type <code>Document</code>, 341f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * this exception might be raised if the DOM implementation doesn't 342f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * support the replacement of the <code>DocumentType</code> child or 343320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>Element</code> child. 344320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @version DOM Level 3 345adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 346f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes public Node replaceChild(Node newChild, 347adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project Node oldChild) 348adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project throws DOMException; 349adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 350adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 351f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * Removes the child node indicated by <code>oldChild</code> from the list 352adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * of children, and returns it. 353adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @param oldChild The node being removed. 354adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @return The node removed. 355adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @exception DOMException 356adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. 357f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>NOT_FOUND_ERR: Raised if <code>oldChild</code> is not a child of 358adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * this node. 359f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>NOT_SUPPORTED_ERR: if this node is of type <code>Document</code>, 360f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * this exception might be raised if the DOM implementation doesn't 361f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * support the removal of the <code>DocumentType</code> child or the 362320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>Element</code> child. 363320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @version DOM Level 3 364adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 365adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public Node removeChild(Node oldChild) 366adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project throws DOMException; 367adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 368adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 369f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * Adds the node <code>newChild</code> to the end of the list of children 370f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * of this node. If the <code>newChild</code> is already in the tree, it 371adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * is first removed. 372f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @param newChild The node to add.If it is a 373f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>DocumentFragment</code> object, the entire contents of the 374320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * document fragment are moved into the child list of this node 375adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @return The node added. 376adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @exception DOMException 377f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not 378f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * allow children of the type of the <code>newChild</code> node, or if 379f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * the node to append is one of this node's ancestors or this node 380f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * itself, or if this node is of type <code>Document</code> and the 381f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * DOM application attempts to append a second 382320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>DocumentType</code> or <code>Element</code> node. 383f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>WRONG_DOCUMENT_ERR: Raised if <code>newChild</code> was created 384adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * from a different document than the one that created this node. 385f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly or 386320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * if the previous parent of the node being inserted is readonly. 387f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>NOT_SUPPORTED_ERR: if the <code>newChild</code> node is a child 388f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * of the <code>Document</code> node, this exception might be raised 389f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * if the DOM implementation doesn't support the removal of the 390320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>DocumentType</code> child or <code>Element</code> child. 391320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @version DOM Level 3 392adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 393adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public Node appendChild(Node newChild) 394adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project throws DOMException; 395adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 396adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 397adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * Returns whether this node has any children. 398f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @return Returns <code>true</code> if this node has any children, 399adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * <code>false</code> otherwise. 400adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 401adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public boolean hasChildNodes(); 402adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 403adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 404f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * Returns a duplicate of this node, i.e., serves as a generic copy 405320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * constructor for nodes. The duplicate node has no parent ( 406f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>parentNode</code> is <code>null</code>) and no user data. User 407f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * data associated to the imported node is not carried over. However, if 408f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * any <code>UserDataHandlers</code> has been specified along with the 409f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * associated data these handlers will be called with the appropriate 410320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * parameters before this method returns. 411f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>Cloning an <code>Element</code> copies all attributes and their 412f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * values, including those generated by the XML processor to represent 413f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * defaulted attributes, but this method does not copy any children it 414f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * contains unless it is a deep clone. This includes text contained in 415f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * an the <code>Element</code> since the text is contained in a child 416f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>Text</code> node. Cloning an <code>Attr</code> directly, as 417f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * opposed to be cloned as part of an <code>Element</code> cloning 418f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * operation, returns a specified attribute (<code>specified</code> is 419f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>true</code>). Cloning an <code>Attr</code> always clones its 420f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * children, since they represent its value, no matter whether this is a 421f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * deep clone or not. Cloning an <code>EntityReference</code> 422f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * automatically constructs its subtree if a corresponding 423f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>Entity</code> is available, no matter whether this is a deep 424f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * clone or not. Cloning any other type of node simply returns a copy of 425320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * this node. 426f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>Note that cloning an immutable subtree results in a mutable copy, 427adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * but the children of an <code>EntityReference</code> clone are readonly 428f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * . In addition, clones of unspecified <code>Attr</code> nodes are 429f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * specified. And, cloning <code>Document</code>, 430f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>DocumentType</code>, <code>Entity</code>, and 431adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * <code>Notation</code> nodes is implementation dependent. 432f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @param deep If <code>true</code>, recursively clone the subtree under 433f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * the specified node; if <code>false</code>, clone only the node 434320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * itself (and its attributes, if it is an <code>Element</code>). 435adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @return The duplicate node. 436adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 437adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public Node cloneNode(boolean deep); 438adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 439adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 440f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * Puts all <code>Text</code> nodes in the full depth of the sub-tree 441f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * underneath this <code>Node</code>, including attribute nodes, into a 442f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * "normal" form where only structure (e.g., elements, comments, 443f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * processing instructions, CDATA sections, and entity references) 444f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * separates <code>Text</code> nodes, i.e., there are neither adjacent 445f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>Text</code> nodes nor empty <code>Text</code> nodes. This can 446f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * be used to ensure that the DOM view of a document is the same as if 447f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * it were saved and re-loaded, and is useful when operations (such as 448320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * XPointer [<a href='http://www.w3.org/TR/2003/REC-xptr-framework-20030325/'>XPointer</a>] 449f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * lookups) that depend on a particular document tree structure are to 450f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * be used. If the parameter "normalize-characters" of the 451f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>DOMConfiguration</code> object attached to the 452f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>Node.ownerDocument</code> is <code>true</code>, this method 453f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * will also fully normalize the characters of the <code>Text</code> 454f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * nodes. 455f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <p ><b>Note:</b> In cases where the document contains 456f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>CDATASections</code>, the normalize operation alone may not be 457f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * sufficient, since XPointers do not differentiate between 458adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * <code>Text</code> nodes and <code>CDATASection</code> nodes. 459320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @version DOM Level 3 460adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 461adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public void normalize(); 462adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 463adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 464f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * Tests whether the DOM implementation implements a specific feature and 465f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * that feature is supported by this node, as specified in . 466f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @param feature The name of the feature to test. 467f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @param version This is the version number of the feature to test. 468f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @return Returns <code>true</code> if the specified feature is 469adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * supported on this node, <code>false</code> otherwise. 470adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @since DOM Level 2 471adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 472f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes public boolean isSupported(String feature, 473adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project String version); 474adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 475adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 476f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * The namespace URI of this node, or <code>null</code> if it is 477320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * unspecified (see ). 478f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>This is not a computed value that is the result of a namespace 479f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * lookup based on an examination of the namespace declarations in 480adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * scope. It is merely the namespace URI given at creation time. 481f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and 482f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1 483f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * method, such as <code>Document.createElement()</code>, this is always 484320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>null</code>. 485320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <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>] 486f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * an attribute does not inherit its namespace from the element it is 487f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * attached to. If an attribute is not explicitly given a namespace, it 488320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * simply has no namespace. 489adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @since DOM Level 2 490adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 491adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public String getNamespaceURI(); 492adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 493adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 494f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * The namespace prefix of this node, or <code>null</code> if it is 495f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * unspecified. When it is defined to be <code>null</code>, setting it 496320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * has no effect, including if the node is read-only. 497f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>Note that setting this attribute, when permitted, changes the 498f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>nodeName</code> attribute, which holds the qualified name, as 499f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * well as the <code>tagName</code> and <code>name</code> attributes of 500f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * the <code>Element</code> and <code>Attr</code> interfaces, when 501320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * applicable. 502f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>Setting the prefix to <code>null</code> makes it unspecified, 503320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * setting it to an empty string is implementation dependent. 504f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>Note also that changing the prefix of an attribute that is known to 505f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * have a default value, does not make a new attribute with the default 506f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * value and the original prefix appear, since the 507320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>namespaceURI</code> and <code>localName</code> do not change. 508f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and 509f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1 510f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * method, such as <code>createElement</code> from the 511adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * <code>Document</code> interface, this is always <code>null</code>. 512adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @since DOM Level 2 513adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 514adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public String getPrefix(); 515adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 516f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * The namespace prefix of this node, or <code>null</code> if it is 517f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * unspecified. When it is defined to be <code>null</code>, setting it 518320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * has no effect, including if the node is read-only. 519f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>Note that setting this attribute, when permitted, changes the 520f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>nodeName</code> attribute, which holds the qualified name, as 521f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * well as the <code>tagName</code> and <code>name</code> attributes of 522f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * the <code>Element</code> and <code>Attr</code> interfaces, when 523adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * applicable. 524f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>Setting the prefix to <code>null</code> makes it unspecified, 525320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * setting it to an empty string is implementation dependent. 526f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>Note also that changing the prefix of an attribute that is known to 527f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * have a default value, does not make a new attribute with the default 528f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * value and the original prefix appear, since the 529adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * <code>namespaceURI</code> and <code>localName</code> do not change. 530f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and 531f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1 532f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * method, such as <code>createElement</code> from the 533adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * <code>Document</code> interface, this is always <code>null</code>. 534adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @exception DOMException 535f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * INVALID_CHARACTER_ERR: Raised if the specified prefix contains an 536f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * illegal character according to the XML version in use specified in 537320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * the <code>Document.xmlVersion</code> attribute. 538adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. 539f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>NAMESPACE_ERR: Raised if the specified <code>prefix</code> is 540f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * malformed per the Namespaces in XML specification, if the 541f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>namespaceURI</code> of this node is <code>null</code>, if the 542f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * specified prefix is "xml" and the <code>namespaceURI</code> of this 543320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * node is different from "<a href='http://www.w3.org/XML/1998/namespace'> 544f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * http://www.w3.org/XML/1998/namespace</a>", if this node is an attribute and the specified prefix is "xmlns" and 545f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * 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 546320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * this node is "xmlns" [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>] 547320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * . 548adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @since DOM Level 2 549adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 550adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public void setPrefix(String prefix) 551adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project throws DOMException; 552adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 553adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 554adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * Returns the local part of the qualified name of this node. 555f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and 556f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1 557f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * method, such as <code>Document.createElement()</code>, this is always 558320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>null</code>. 559adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @since DOM Level 2 560adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 561adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public String getLocalName(); 562adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 563adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 564adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * Returns whether this node (if it is an element) has any attributes. 565f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @return Returns <code>true</code> if this node has any attributes, 566adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * <code>false</code> otherwise. 567adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @since DOM Level 2 568adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 569adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public boolean hasAttributes(); 570adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 571320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson /** 572f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * The absolute base URI of this node or <code>null</code> if the 573f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * implementation wasn't able to obtain an absolute URI. This value is 574f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * computed as described in . However, when the <code>Document</code> 575320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * supports the feature "HTML" [<a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>DOM Level 2 HTML</a>] 576f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * , the base URI is computed using first the value of the href 577f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * attribute of the HTML BASE element if any, and the value of the 578f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>documentURI</code> attribute from the <code>Document</code> 579320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * interface otherwise. 580320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @since DOM Level 3 581320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson */ 582320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson public String getBaseURI(); 583320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson 584320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson // DocumentPosition 585320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson /** 586f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * The two nodes are disconnected. Order between disconnected nodes is 587320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * always implementation-specific. 588320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson */ 589320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson public static final short DOCUMENT_POSITION_DISCONNECTED = 0x01; 590320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson /** 591320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * The second node precedes the reference node. 592320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson */ 593320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson public static final short DOCUMENT_POSITION_PRECEDING = 0x02; 594320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson /** 595320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * The node follows the reference node. 596320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson */ 597320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson public static final short DOCUMENT_POSITION_FOLLOWING = 0x04; 598320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson /** 599f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * The node contains the reference node. A node which contains is always 600320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * preceding, too. 601320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson */ 602320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson public static final short DOCUMENT_POSITION_CONTAINS = 0x08; 603320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson /** 604f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * The node is contained by the reference node. A node which is contained 605320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * is always following, too. 606320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson */ 607320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson public static final short DOCUMENT_POSITION_CONTAINED_BY = 0x10; 608320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson /** 609f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * The determination of preceding versus following is 610320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * implementation-specific. 611320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson */ 612320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson public static final short DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0x20; 613320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson 614320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson /** 615f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * Compares the reference node, i.e. the node on which this method is 616f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * being called, with a node, i.e. the one passed as a parameter, with 617f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * regard to their position in the document and according to the 618320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * document order. 619320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @param other The node to compare against the reference node. 620f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @return Returns how the node is positioned relatively to the reference 621320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * node. 622320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @exception DOMException 623f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * NOT_SUPPORTED_ERR: when the compared nodes are from different DOM 624f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * implementations that do not coordinate to return consistent 625320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * implementation-specific results. 626320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @since DOM Level 3 627320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson */ 628320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson public short compareDocumentPosition(Node other) 629320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson throws DOMException; 630320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson 631320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson /** 632f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * This attribute returns the text content of this node and its 633f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * descendants. When it is defined to be <code>null</code>, setting it 634f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * has no effect. On setting, any possible children this node may have 635f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * are removed and, if it the new string is not empty or 636f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>null</code>, replaced by a single <code>Text</code> node 637f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * containing the string this attribute is set to. 638f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br> On getting, no serialization is performed, the returned string 639f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * does not contain any markup. No whitespace normalization is performed 640f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * and the returned string does not contain the white spaces in element 641f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * content (see the attribute 642f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>Text.isElementContentWhitespace</code>). Similarly, on setting, 643f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * no parsing is performed either, the input string is taken as pure 644f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * textual content. 645f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>The string returned is made of the text content of this node 646f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * depending on its type, as defined below: 647320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <table border='1' cellpadding='3'> 648320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <tr> 649320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <th>Node type</th> 650320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <th>Content</th> 651320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </tr> 652320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <tr> 653320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'> 654f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * ELEMENT_NODE, ATTRIBUTE_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, 655320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * DOCUMENT_FRAGMENT_NODE</td> 656f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <td valign='top' rowspan='1' colspan='1'>concatenation of the <code>textContent</code> 657f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * attribute value of every child node, excluding COMMENT_NODE and 658f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * PROCESSING_INSTRUCTION_NODE nodes. This is the empty string if the 659320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * node has no children.</td> 660320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </tr> 661320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <tr> 662f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <td valign='top' rowspan='1' colspan='1'>TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE, 663320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * PROCESSING_INSTRUCTION_NODE</td> 664320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'><code>nodeValue</code></td> 665320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </tr> 666320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <tr> 667f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <td valign='top' rowspan='1' colspan='1'>DOCUMENT_NODE, 668320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * DOCUMENT_TYPE_NODE, NOTATION_NODE</td> 669320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'><em>null</em></td> 670320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </tr> 671320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </table> 672320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @exception DOMException 673f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * DOMSTRING_SIZE_ERR: Raised when it would return more characters than 674f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * fit in a <code>DOMString</code> variable on the implementation 675320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * platform. 676320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @since DOM Level 3 677320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson */ 678320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson public String getTextContent() 679320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson throws DOMException; 680320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson /** 681f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * This attribute returns the text content of this node and its 682f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * descendants. When it is defined to be <code>null</code>, setting it 683f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * has no effect. On setting, any possible children this node may have 684f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * are removed and, if it the new string is not empty or 685f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>null</code>, replaced by a single <code>Text</code> node 686f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * containing the string this attribute is set to. 687f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br> On getting, no serialization is performed, the returned string 688f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * does not contain any markup. No whitespace normalization is performed 689f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * and the returned string does not contain the white spaces in element 690f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * content (see the attribute 691f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>Text.isElementContentWhitespace</code>). Similarly, on setting, 692f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * no parsing is performed either, the input string is taken as pure 693f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * textual content. 694f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>The string returned is made of the text content of this node 695f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * depending on its type, as defined below: 696320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <table border='1' cellpadding='3'> 697320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <tr> 698320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <th>Node type</th> 699320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <th>Content</th> 700320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </tr> 701320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <tr> 702320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'> 703f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * ELEMENT_NODE, ATTRIBUTE_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, 704320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * DOCUMENT_FRAGMENT_NODE</td> 705f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <td valign='top' rowspan='1' colspan='1'>concatenation of the <code>textContent</code> 706f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * attribute value of every child node, excluding COMMENT_NODE and 707f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * PROCESSING_INSTRUCTION_NODE nodes. This is the empty string if the 708320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * node has no children.</td> 709320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </tr> 710320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <tr> 711f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <td valign='top' rowspan='1' colspan='1'>TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE, 712320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * PROCESSING_INSTRUCTION_NODE</td> 713320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'><code>nodeValue</code></td> 714320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </tr> 715320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <tr> 716f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <td valign='top' rowspan='1' colspan='1'>DOCUMENT_NODE, 717320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * DOCUMENT_TYPE_NODE, NOTATION_NODE</td> 718320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <td valign='top' rowspan='1' colspan='1'><em>null</em></td> 719320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </tr> 720320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </table> 721320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @exception DOMException 722320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. 723320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @since DOM Level 3 724320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson */ 725320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson public void setTextContent(String textContent) 726320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson throws DOMException; 727320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson 728320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson /** 729320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * Returns whether this node is the same node as the given one. 730f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>This method provides a way to determine whether two 731f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>Node</code> references returned by the implementation reference 732f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * the same object. When two <code>Node</code> references are references 733f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * to the same object, even if through a proxy, the references may be 734f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * used completely interchangeably, such that all attributes have the 735f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * same values and calling the same DOM method on either reference 736320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * always has exactly the same effect. 737320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @param other The node to test against. 738f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @return Returns <code>true</code> if the nodes are the same, 739320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>false</code> otherwise. 740320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @since DOM Level 3 741320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson */ 742320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson public boolean isSameNode(Node other); 743320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson 744320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson /** 745f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * Look up the prefix associated to the given namespace URI, starting from 746f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * this node. The default namespace declarations are ignored by this 747320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * method. 748320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <br>See for details on the algorithm used by this method. 749320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @param namespaceURI The namespace URI to look for. 750f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @return Returns an associated namespace prefix if found or 751f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>null</code> if none is found. If more than one prefix are 752f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * associated to the namespace prefix, the returned namespace prefix 753320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * is implementation dependent. 754320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @since DOM Level 3 755320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson */ 756320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson public String lookupPrefix(String namespaceURI); 757320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson 758320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson /** 759f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * This method checks if the specified <code>namespaceURI</code> is the 760f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * default namespace or not. 761320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @param namespaceURI The namespace URI to look for. 762f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @return Returns <code>true</code> if the specified 763f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>namespaceURI</code> is the default namespace, 764f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>false</code> otherwise. 765320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @since DOM Level 3 766320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson */ 767320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson public boolean isDefaultNamespace(String namespaceURI); 768320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson 769320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson /** 770f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * Look up the namespace URI associated to the given prefix, starting from 771320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * this node. 772320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <br>See for details on the algorithm used by this method. 773f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @param prefix The prefix to look for. If this parameter is 774f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>null</code>, the method will return the default namespace URI 775320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * if any. 776f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @return Returns the associated namespace URI or <code>null</code> if 777320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * none is found. 778320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @since DOM Level 3 779320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson */ 780320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson public String lookupNamespaceURI(String prefix); 781320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson 782320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson /** 783320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * Tests whether two nodes are equal. 784f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>This method tests for equality of nodes, not sameness (i.e., 785f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * whether the two nodes are references to the same object) which can be 786f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * tested with <code>Node.isSameNode()</code>. All nodes that are the 787320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * same will also be equal, though the reverse may not be true. 788f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>Two nodes are equal if and only if the following conditions are 789f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * satisfied: 790320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <ul> 791320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <li>The two nodes are of the same type. 792320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </li> 793f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <li>The following string 794f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * attributes are equal: <code>nodeName</code>, <code>localName</code>, 795320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>namespaceURI</code>, <code>prefix</code>, <code>nodeValue</code> 796f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * . This is: they are both <code>null</code>, or they have the same 797320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * length and are character for character identical. 798320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </li> 799f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <li>The 800f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>attributes</code> <code>NamedNodeMaps</code> are equal. This 801f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * is: they are both <code>null</code>, or they have the same length and 802f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * for each node that exists in one map there is a node that exists in 803f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * the other map and is equal, although not necessarily at the same 804320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * index. 805320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </li> 806f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <li>The <code>childNodes</code> <code>NodeLists</code> are equal. 807f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * This is: they are both <code>null</code>, or they have the same 808f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * length and contain equal nodes at the same index. Note that 809f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * normalization can affect equality; to avoid this, nodes should be 810320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * normalized before being compared. 811320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </li> 812f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * </ul> 813f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>For two <code>DocumentType</code> nodes to be equal, the following 814f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * conditions must also be satisfied: 815320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <ul> 816f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <li>The following string attributes 817f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * are equal: <code>publicId</code>, <code>systemId</code>, 818320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>internalSubset</code>. 819320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </li> 820f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <li>The <code>entities</code> 821320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>NamedNodeMaps</code> are equal. 822320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </li> 823f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <li>The <code>notations</code> 824320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>NamedNodeMaps</code> are equal. 825320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </li> 826f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * </ul> 827f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>On the other hand, the following do not affect equality: the 828f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>ownerDocument</code>, <code>baseURI</code>, and 829f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>parentNode</code> attributes, the <code>specified</code> 830320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * attribute for <code>Attr</code> nodes, the <code>schemaTypeInfo</code> 831f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * attribute for <code>Attr</code> and <code>Element</code> nodes, the 832f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>Text.isElementContentWhitespace</code> attribute for 833f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>Text</code> nodes, as well as any user data or event listeners 834f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * registered on the nodes. 835f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <p ><b>Note:</b> As a general rule, anything not mentioned in the 836f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * description above is not significant in consideration of equality 837f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * checking. Note that future versions of this specification may take 838f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * into account more attributes and implementations conform to this 839f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * specification are expected to be updated accordingly. 840320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @param arg The node to compare equality with. 841f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @return Returns <code>true</code> if the nodes are equal, 842320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>false</code> otherwise. 843320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @since DOM Level 3 844320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson */ 845320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson public boolean isEqualNode(Node arg); 846320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson 847320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson /** 848f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * This method returns a specialized object which implements the 849f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * specialized APIs of the specified feature and version, as specified 850f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * in . The specialized object may also be obtained by using 851f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * binding-specific casting methods but is not necessarily expected to, 852f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * as discussed in . This method also allow the implementation to 853320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * provide specialized objects which do not support the <code>Node</code> 854f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * interface. 855f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @param feature The name of the feature requested. Note that any plus 856f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * sign "+" prepended to the name of the feature will be ignored since 857f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * it is not significant in the context of this method. 858f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @param version This is the version number of the feature to test. 859f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @return Returns an object which implements the specialized APIs of 860f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * the specified feature and version, if any, or <code>null</code> if 861f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * there is no object which implements interfaces associated with that 862f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * feature. If the <code>DOMObject</code> returned by this method 863f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * implements the <code>Node</code> interface, it must delegate to the 864f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * primary core <code>Node</code> and not return results inconsistent 865f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * with the primary core <code>Node</code> such as attributes, 866f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * childNodes, etc. 867320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @since DOM Level 3 868320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson */ 869f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes public Object getFeature(String feature, 870320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson String version); 871320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson 872320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson /** 873f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * Associate an object to a key on this node. The object can later be 874f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * retrieved from this node by calling <code>getUserData</code> with the 875320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * same key. 876320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @param key The key to associate the object to. 877f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @param data The object to associate to the given key, or 878320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>null</code> to remove any existing association to that key. 879f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @param handler The handler to associate to that key, or 880320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>null</code>. 881f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @return Returns the <code>DOMUserData</code> previously associated to 882320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * the given key on this node, or <code>null</code> if there was none. 883320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @since DOM Level 3 884320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson */ 885f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes public Object setUserData(String key, 886f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes Object data, 887320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson UserDataHandler handler); 888320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson 889320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson /** 890f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * Retrieves the object associated to a key on a this node. The object 891f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * must first have been set to this node by calling 892320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>setUserData</code> with the same key. 893320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @param key The key the object is associated to. 894f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @return Returns the <code>DOMUserData</code> associated to the given 895320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * key on this node, or <code>null</code> if there was none. 896320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @since DOM Level 3 897320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson */ 898320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson public Object getUserData(String key); 899320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson 900adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project} 901