1 /* 2 * Copyright (c) 2002 World Wide Web Consortium, 3 * (Massachusetts Institute of Technology, Institut National de 4 * Recherche en Informatique et en Automatique, Keio University). All 5 * Rights Reserved. This program is distributed under the W3C's Software 6 * Intellectual Property License. This program is distributed in the 7 * hope that it will be useful, but WITHOUT ANY WARRANTY; without even 8 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 9 * PURPOSE. 10 * See W3C License http://www.w3.org/Consortium/Legal/ for more details. 11 */ 12 13 package org.w3c.dom.xpath; 14 15 16 import org.w3c.dom.Element; 17 import org.w3c.dom.Node; 18 19 /** 20 * The <code>XPathNamespace</code> interface is returned by 21 * <code>XPathResult</code> interfaces to represent the XPath namespace node 22 * type that DOM lacks. There is no public constructor for this node type. 23 * Attempts to place it into a hierarchy or a NamedNodeMap result in a 24 * <code>DOMException</code> with the code <code>HIERARCHY_REQUEST_ERR</code> 25 * . This node is read only, so methods or setting of attributes that would 26 * mutate the node result in a DOMException with the code 27 * <code>NO_MODIFICATION_ALLOWED_ERR</code>. 28 * <p>The core specification describes attributes of the <code>Node</code> 29 * interface that are different for different node node types but does not 30 * describe <code>XPATH_NAMESPACE_NODE</code>, so here is a description of 31 * those attributes for this node type. All attributes of <code>Node</code> 32 * not described in this section have a <code>null</code> or 33 * <code>false</code> value. 34 * <p><code>ownerDocument</code> matches the <code>ownerDocument</code> of the 35 * <code>ownerElement</code> even if the element is later adopted. 36 * <p><code>prefix</code> is the prefix of the namespace represented by the 37 * node. 38 * <p><code>nodeName</code> is the same as <code>prefix</code>. 39 * <p><code>nodeType</code> is equal to <code>XPATH_NAMESPACE_NODE</code>. 40 * <p><code>namespaceURI</code> is the namespace URI of the namespace 41 * represented by the node. 42 * <p><code>adoptNode</code>, <code>cloneNode</code>, and 43 * <code>importNode</code> fail on this node type by raising a 44 * <code>DOMException</code> with the code <code>NOT_SUPPORTED_ERR</code>.In 45 * future versions of the XPath specification, the definition of a namespace 46 * node may be changed incomatibly, in which case incompatible changes to 47 * field values may be required to implement versions beyond XPath 1.0. 48 * <p>See also the <a HREF='http://www.w3.org/2002/08/WD-DOM-Level-3-XPath-20020820'>Document Object Model (DOM) Level 3 XPath Specification</a>. 49 */ 50 public interface XPathNamespace extends Node { 51 // XPathNodeType 52 /** 53 * The node is a <code>Namespace</code>. 54 */ 55 public static final short XPATH_NAMESPACE_NODE = 13; 56 57 /** 58 * The <code>Element</code> on which the namespace was in scope when it 59 * was requested. This does not change on a returned namespace node even 60 * if the document changes such that the namespace goes out of scope on 61 * that element and this node is no longer found there by XPath. 62 */ 63 public Element getOwnerElement(); 64 65 } 66