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>Element</code> interface represents an element in an HTML or XML 17f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * document. Elements may have attributes associated with them; since the 18f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>Element</code> interface inherits from <code>Node</code>, the 19f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * generic <code>Node</code> interface attribute <code>attributes</code> may 20f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * be used to retrieve the set of all attributes for an element. There are 21f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * methods on the <code>Element</code> interface to retrieve either an 22f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>Attr</code> object by name or an attribute value by name. In XML, 23f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * where an attribute value may contain entity references, an 24f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>Attr</code> object should be retrieved to examine the possibly 25f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * fairly complex sub-tree representing the attribute value. On the other 26f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * hand, in HTML, where all attributes have simple string values, methods to 27320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * directly access an attribute value can safely be used as a convenience. 28f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <p ><b>Note:</b> In DOM Level 2, the method <code>normalize</code> is 29320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * inherited from the <code>Node</code> interface where it was moved. 30320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse 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>. 31adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 32adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Projectpublic interface Element extends Node { 33adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 34f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * The name of the element. If <code>Node.localName</code> is different 35f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * from <code>null</code>, this attribute is a qualified name. For 36f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * example, in: 37f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <pre> <elementExample id="demo"> ... 38320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * </elementExample> , </pre> 39f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>tagName</code> has the value 40f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>"elementExample"</code>. Note that this is case-preserving in 41f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * XML, as are all of the operations of the DOM. The HTML DOM returns 42f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * the <code>tagName</code> of an HTML element in the canonical 43320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * uppercase form, regardless of the case in the source HTML document. 44adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 45adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public String getTagName(); 46adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 47adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 48adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * Retrieves an attribute value by name. 49adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @param name The name of the attribute to retrieve. 50f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @return The <code>Attr</code> value as a string, or the empty string 51adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * if that attribute does not have a specified or default value. 52adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 53adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public String getAttribute(String name); 54adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 55adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 56f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * Adds a new attribute. If an attribute with that name is already present 57f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * in the element, its value is changed to be that of the value 58f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * parameter. This value is a simple string; it is not parsed as it is 59f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * being set. So any markup (such as syntax to be recognized as an 60f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * entity reference) is treated as literal text, and needs to be 61f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * appropriately escaped by the implementation when it is written out. 62f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * In order to assign an attribute value that contains entity 63f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * references, the user must create an <code>Attr</code> node plus any 64f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>Text</code> and <code>EntityReference</code> nodes, build the 65f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * appropriate subtree, and use <code>setAttributeNode</code> to assign 66adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * it as the value of an attribute. 67f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>To set an attribute with a qualified name and namespace URI, use 68adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * the <code>setAttributeNS</code> method. 69adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @param name The name of the attribute to create or alter. 70adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @param value Value to set in string form. 71adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @exception DOMException 72f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * INVALID_CHARACTER_ERR: Raised if the specified name is not an XML 73f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * name according to the XML version in use specified in the 74320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>Document.xmlVersion</code> attribute. 75adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. 76adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 77f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes public void setAttribute(String name, 78adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project String value) 79adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project throws DOMException; 80adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 81adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 82f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * Removes an attribute by name. If a default value for the removed 83f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * attribute is defined in the DTD, a new attribute immediately appears 84f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * with the default value as well as the corresponding namespace URI, 85f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * local name, and prefix when applicable. The implementation may handle 86f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * default values from other schemas similarly but applications should 87f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * use <code>Document.normalizeDocument()</code> to guarantee this 88320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * information is up-to-date. 89320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <br>If no attribute with this name is found, this method has no effect. 90f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>To remove an attribute by local name and namespace URI, use the 91adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * <code>removeAttributeNS</code> method. 92adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @param name The name of the attribute to remove. 93adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @exception DOMException 94adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. 95adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 96adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public void removeAttribute(String name) 97adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project throws DOMException; 98adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 99adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 100adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * Retrieves an attribute node by name. 101f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>To retrieve an attribute node by qualified name and namespace URI, 102adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * use the <code>getAttributeNodeNS</code> method. 103f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @param name The name (<code>nodeName</code>) of the attribute to 104adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * retrieve. 105adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @return The <code>Attr</code> node with the specified name ( 106f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>nodeName</code>) or <code>null</code> if there is no such 107adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * attribute. 108adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 109adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public Attr getAttributeNode(String name); 110adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 111adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 112adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * Adds a new attribute node. If an attribute with that name ( 113f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>nodeName</code>) is already present in the element, it is 114f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * replaced by the new one. Replacing an attribute node by itself has no 115320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * effect. 116f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>To add a new attribute node with a qualified name and namespace 117adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * URI, use the <code>setAttributeNodeNS</code> method. 118adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @param newAttr The <code>Attr</code> node to add to the attribute list. 119f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @return If the <code>newAttr</code> attribute replaces an existing 120f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * attribute, the replaced <code>Attr</code> node is returned, 121adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * otherwise <code>null</code> is returned. 122adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @exception DOMException 123f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * WRONG_DOCUMENT_ERR: Raised if <code>newAttr</code> was created from a 124adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * different document than the one that created the element. 125adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. 126f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>INUSE_ATTRIBUTE_ERR: Raised if <code>newAttr</code> is already an 127f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * attribute of another <code>Element</code> object. The DOM user must 128f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * explicitly clone <code>Attr</code> nodes to re-use them in other 129adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * elements. 130adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 131adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public Attr setAttributeNode(Attr newAttr) 132adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project throws DOMException; 133adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 134adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 135f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * Removes the specified attribute node. If a default value for the 136f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * removed <code>Attr</code> node is defined in the DTD, a new node 137f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * immediately appears with the default value as well as the 138f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * corresponding namespace URI, local name, and prefix when applicable. 139f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * The implementation may handle default values from other schemas 140f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * similarly but applications should use 141f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>Document.normalizeDocument()</code> to guarantee this 142320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * information is up-to-date. 143f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @param oldAttr The <code>Attr</code> node to remove from the attribute 144adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * list. 145adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @return The <code>Attr</code> node that was removed. 146adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @exception DOMException 147adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. 148f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>NOT_FOUND_ERR: Raised if <code>oldAttr</code> is not an attribute 149adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * of the element. 150adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 151adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public Attr removeAttributeNode(Attr oldAttr) 152adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project throws DOMException; 153adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 154adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 155f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * Returns a <code>NodeList</code> of all descendant <code>Elements</code> 156320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * with a given tag name, in document order. 157f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @param name The name of the tag to match on. The special value "*" 158adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * matches all tags. 159adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @return A list of matching <code>Element</code> nodes. 160adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 161adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public NodeList getElementsByTagName(String name); 162adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 163adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 164320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * Retrieves an attribute value by local name and namespace URI. 165320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <br>Per [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>] 166f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * , applications must use the value <code>null</code> as the 167f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>namespaceURI</code> parameter for methods if they wish to have 168320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * no namespace. 169adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @param namespaceURI The namespace URI of the attribute to retrieve. 170adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @param localName The local name of the attribute to retrieve. 171f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @return The <code>Attr</code> value as a string, or the empty string 172adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * if that attribute does not have a specified or default value. 173320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @exception DOMException 174f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * NOT_SUPPORTED_ERR: May be raised if the implementation does not 175f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * support the feature <code>"XML"</code> and the language exposed 176f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * through the Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]). 177adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @since DOM Level 2 178adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 179f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes public String getAttributeNS(String namespaceURI, 180320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson String localName) 181320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson throws DOMException; 182adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 183adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 184f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * Adds a new attribute. If an attribute with the same local name and 185f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * namespace URI is already present on the element, its prefix is 186f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * changed to be the prefix part of the <code>qualifiedName</code>, and 187f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * its value is changed to be the <code>value</code> parameter. This 188f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * value is a simple string; it is not parsed as it is being set. So any 189f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * markup (such as syntax to be recognized as an entity reference) is 190f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * treated as literal text, and needs to be appropriately escaped by the 191f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * implementation when it is written out. In order to assign an 192f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * attribute value that contains entity references, the user must create 193f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * an <code>Attr</code> node plus any <code>Text</code> and 194f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>EntityReference</code> nodes, build the appropriate subtree, 195f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * and use <code>setAttributeNodeNS</code> or 196f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>setAttributeNode</code> to assign it as the value of an 197adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * attribute. 198320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <br>Per [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>] 199f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * , applications must use the value <code>null</code> as the 200f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>namespaceURI</code> parameter for methods if they wish to have 201320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * no namespace. 202f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @param namespaceURI The namespace URI of the attribute to create or 203adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * alter. 204f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @param qualifiedName The qualified name of the attribute to create or 205adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * alter. 206adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @param value The value to set in string form. 207adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @exception DOMException 208f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * INVALID_CHARACTER_ERR: Raised if the specified qualified name is not 209f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * an XML name according to the XML version in use specified in the 210320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>Document.xmlVersion</code> attribute. 211adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. 212f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is 213f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * malformed per the Namespaces in XML specification, if the 214f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>qualifiedName</code> has a prefix and the 215f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>namespaceURI</code> is <code>null</code>, if the 216f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>qualifiedName</code> has a prefix that is "xml" and the 217320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>namespaceURI</code> is different from "<a href='http://www.w3.org/XML/1998/namespace'> 218f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * http://www.w3.org/XML/1998/namespace</a>", if the <code>qualifiedName</code> or its prefix is "xmlns" and the 219320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>namespaceURI</code> is different from "<a href='http://www.w3.org/2000/xmlns/'>http://www.w3.org/2000/xmlns/</a>", or if the <code>namespaceURI</code> is "<a href='http://www.w3.org/2000/xmlns/'>http://www.w3.org/2000/xmlns/</a>" and neither the <code>qualifiedName</code> nor its prefix is "xmlns". 220f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>NOT_SUPPORTED_ERR: May be raised if the implementation does not 221f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * support the feature <code>"XML"</code> and the language exposed 222f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * through the Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]). 223adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @since DOM Level 2 224adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 225f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes public void setAttributeNS(String namespaceURI, 226f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes String qualifiedName, 227adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project String value) 228adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project throws DOMException; 229adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 230adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 231f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * Removes an attribute by local name and namespace URI. If a default 232f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * value for the removed attribute is defined in the DTD, a new 233f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * attribute immediately appears with the default value as well as the 234f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * corresponding namespace URI, local name, and prefix when applicable. 235f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * The implementation may handle default values from other schemas 236f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * similarly but applications should use 237f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>Document.normalizeDocument()</code> to guarantee this 238320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * information is up-to-date. 239f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>If no attribute with this local name and namespace URI is found, 240320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * this method has no effect. 241320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <br>Per [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>] 242f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * , applications must use the value <code>null</code> as the 243f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>namespaceURI</code> parameter for methods if they wish to have 244320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * no namespace. 245adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @param namespaceURI The namespace URI of the attribute to remove. 246adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @param localName The local name of the attribute to remove. 247adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @exception DOMException 248adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. 249f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>NOT_SUPPORTED_ERR: May be raised if the implementation does not 250f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * support the feature <code>"XML"</code> and the language exposed 251f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * through the Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]). 252adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @since DOM Level 2 253adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 254f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes public void removeAttributeNS(String namespaceURI, 255adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project String localName) 256adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project throws DOMException; 257adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 258adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 259320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * Retrieves an <code>Attr</code> node by local name and namespace URI. 260320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <br>Per [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>] 261f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * , applications must use the value <code>null</code> as the 262f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>namespaceURI</code> parameter for methods if they wish to have 263320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * no namespace. 264adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @param namespaceURI The namespace URI of the attribute to retrieve. 265adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @param localName The local name of the attribute to retrieve. 266f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @return The <code>Attr</code> node with the specified attribute local 267f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * name and namespace URI or <code>null</code> if there is no such 268adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * attribute. 269320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @exception DOMException 270f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * NOT_SUPPORTED_ERR: May be raised if the implementation does not 271f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * support the feature <code>"XML"</code> and the language exposed 272f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * through the Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]). 273adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @since DOM Level 2 274adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 275f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes public Attr getAttributeNodeNS(String namespaceURI, 276320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson String localName) 277320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson throws DOMException; 278adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 279adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 280f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * Adds a new attribute. If an attribute with that local name and that 281f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * namespace URI is already present in the element, it is replaced by 282320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * the new one. Replacing an attribute node by itself has no effect. 283320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <br>Per [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>] 284f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * , applications must use the value <code>null</code> as the 285f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>namespaceURI</code> parameter for methods if they wish to have 286320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * no namespace. 287adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @param newAttr The <code>Attr</code> node to add to the attribute list. 288f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @return If the <code>newAttr</code> attribute replaces an existing 289f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * attribute with the same local name and namespace URI, the replaced 290f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>Attr</code> node is returned, otherwise <code>null</code> is 291adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * returned. 292adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @exception DOMException 293f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * WRONG_DOCUMENT_ERR: Raised if <code>newAttr</code> was created from a 294adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * different document than the one that created the element. 295adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. 296f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>INUSE_ATTRIBUTE_ERR: Raised if <code>newAttr</code> is already an 297f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * attribute of another <code>Element</code> object. The DOM user must 298f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * explicitly clone <code>Attr</code> nodes to re-use them in other 299adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * elements. 300f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>NOT_SUPPORTED_ERR: May be raised if the implementation does not 301f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * support the feature <code>"XML"</code> and the language exposed 302f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * through the Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]). 303adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @since DOM Level 2 304adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 305adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public Attr setAttributeNodeNS(Attr newAttr) 306adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project throws DOMException; 307adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 308adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 309f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * Returns a <code>NodeList</code> of all the descendant 310f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>Elements</code> with a given local name and namespace URI in 311320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * document order. 312f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @param namespaceURI The namespace URI of the elements to match on. The 313adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * special value "*" matches all namespaces. 314f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @param localName The local name of the elements to match on. The 315adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * special value "*" matches all local names. 316f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @return A new <code>NodeList</code> object containing all the matched 317adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * <code>Elements</code>. 318320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @exception DOMException 319f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * NOT_SUPPORTED_ERR: May be raised if the implementation does not 320f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * support the feature <code>"XML"</code> and the language exposed 321f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * through the Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]). 322adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @since DOM Level 2 323adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 324f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes public NodeList getElementsByTagNameNS(String namespaceURI, 325320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson String localName) 326320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson throws DOMException; 327adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 328adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 329f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * Returns <code>true</code> when an attribute with a given name is 330f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * specified on this element or has a default value, <code>false</code> 331adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * otherwise. 332adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @param name The name of the attribute to look for. 333f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @return <code>true</code> if an attribute with the given name is 334adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * specified on this element or has a default value, <code>false</code> 335adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * otherwise. 336adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @since DOM Level 2 337adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 338adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project public boolean hasAttribute(String name); 339adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 340adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project /** 341f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * Returns <code>true</code> when an attribute with a given local name and 342f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * namespace URI is specified on this element or has a default value, 343320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <code>false</code> otherwise. 344320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * <br>Per [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>] 345f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * , applications must use the value <code>null</code> as the 346f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>namespaceURI</code> parameter for methods if they wish to have 347320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * no namespace. 348adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @param namespaceURI The namespace URI of the attribute to look for. 349adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @param localName The local name of the attribute to look for. 350f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * @return <code>true</code> if an attribute with the given local name 351f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * and namespace URI is specified or has a default value on this 352adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * element, <code>false</code> otherwise. 353320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @exception DOMException 354f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * NOT_SUPPORTED_ERR: May be raised if the implementation does not 355f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * support the feature <code>"XML"</code> and the language exposed 356f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * through the Document does not support XML Namespaces (such as [<a href='http://www.w3.org/TR/1999/REC-html401-19991224/'>HTML 4.01</a>]). 357adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project * @since DOM Level 2 358adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project */ 359f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes public boolean hasAttributeNS(String namespaceURI, 360320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson String localName) 361320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson throws DOMException; 362320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson 363320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson /** 364f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * The type information associated with this element. 365320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @since DOM Level 3 366320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson */ 367320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson public TypeInfo getSchemaTypeInfo(); 368320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson 369320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson /** 370f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * If the parameter <code>isId</code> is <code>true</code>, this method 371320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * declares the specified attribute to be a user-determined ID attribute 372f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * . This affects the value of <code>Attr.isId</code> and the behavior 373f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * of <code>Document.getElementById</code>, but does not change any 374f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * schema that may be in use, in particular this does not affect the 375f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>Attr.schemaTypeInfo</code> of the specified <code>Attr</code> 376f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * node. Use the value <code>false</code> for the parameter 377f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>isId</code> to undeclare an attribute for being a 378f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * user-determined ID attribute. 379f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br> To specify an attribute by local name and namespace URI, use the 380f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>setIdAttributeNS</code> method. 381320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @param name The name of the attribute. 382320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @param isId Whether the attribute is a of type ID. 383320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @exception DOMException 384320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. 385f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>NOT_FOUND_ERR: Raised if the specified node is not an attribute 386320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * of this element. 387320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @since DOM Level 3 388320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson */ 389f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes public void setIdAttribute(String name, 390320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson boolean isId) 391320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson throws DOMException; 392320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson 393320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson /** 394f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * If the parameter <code>isId</code> is <code>true</code>, this method 395320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * declares the specified attribute to be a user-determined ID attribute 396f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * . This affects the value of <code>Attr.isId</code> and the behavior 397f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * of <code>Document.getElementById</code>, but does not change any 398f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * schema that may be in use, in particular this does not affect the 399f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>Attr.schemaTypeInfo</code> of the specified <code>Attr</code> 400f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * node. Use the value <code>false</code> for the parameter 401f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>isId</code> to undeclare an attribute for being a 402f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * user-determined ID attribute. 403320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @param namespaceURI The namespace URI of the attribute. 404320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @param localName The local name of the attribute. 405320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @param isId Whether the attribute is a of type ID. 406320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @exception DOMException 407320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. 408f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>NOT_FOUND_ERR: Raised if the specified node is not an attribute 409320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * of this element. 410320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @since DOM Level 3 411320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson */ 412f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes public void setIdAttributeNS(String namespaceURI, 413f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes String localName, 414320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson boolean isId) 415320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson throws DOMException; 416320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson 417320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson /** 418f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * If the parameter <code>isId</code> is <code>true</code>, this method 419320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * declares the specified attribute to be a user-determined ID attribute 420f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * . This affects the value of <code>Attr.isId</code> and the behavior 421f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * of <code>Document.getElementById</code>, but does not change any 422f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * schema that may be in use, in particular this does not affect the 423f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>Attr.schemaTypeInfo</code> of the specified <code>Attr</code> 424f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * node. Use the value <code>false</code> for the parameter 425f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <code>isId</code> to undeclare an attribute for being a 426f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * user-determined ID attribute. 427320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @param idAttr The attribute node. 428320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @param isId Whether the attribute is a of type ID. 429320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @exception DOMException 430320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. 431f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes * <br>NOT_FOUND_ERR: Raised if the specified node is not an attribute 432320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * of this element. 433320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson * @since DOM Level 3 434320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson */ 435f33eae7e84eb6d3b0f4e86b59605bb3de73009f3Elliott Hughes public void setIdAttributeNode(Attr idAttr, 436320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson boolean isId) 437320c9890e8241fb0ad05de6fa5e6c3eb3aece159Jesse Wilson throws DOMException; 438adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project 439adc854b798c1cfe3bfd4c27d68d5cee38ca617daThe Android Open Source Project} 440