286N/A/*
286N/A * reserved comment block
286N/A * DO NOT REMOVE OR ALTER!
286N/A */
286N/A/*
286N/A * Copyright 1999-2004 The Apache Software Foundation.
286N/A *
286N/A * Licensed under the Apache License, Version 2.0 (the "License");
286N/A * you may not use this file except in compliance with the License.
286N/A * You may obtain a copy of the License at
286N/A *
286N/A * http://www.apache.org/licenses/LICENSE-2.0
286N/A *
286N/A * Unless required by applicable law or agreed to in writing, software
286N/A * distributed under the License is distributed on an "AS IS" BASIS,
286N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
286N/A * See the License for the specific language governing permissions and
286N/A * limitations under the License.
286N/A */
286N/A/*
286N/A * $Id: UnImplNode.java,v
286N/A */
286N/Apackage com.sun.org.apache.xml.internal.utils;
286N/A
286N/Aimport com.sun.org.apache.xml.internal.res.XMLErrorResources;
286N/Aimport com.sun.org.apache.xml.internal.res.XMLMessages;
286N/A
286N/Aimport org.w3c.dom.Attr;
286N/Aimport org.w3c.dom.CDATASection;
286N/Aimport org.w3c.dom.Comment;
286N/Aimport org.w3c.dom.DOMException;
286N/Aimport org.w3c.dom.DOMImplementation;
286N/Aimport org.w3c.dom.Document;
286N/Aimport org.w3c.dom.DocumentFragment;
286N/Aimport org.w3c.dom.DocumentType;
286N/Aimport org.w3c.dom.Element;
286N/Aimport org.w3c.dom.EntityReference;
286N/Aimport org.w3c.dom.NamedNodeMap;
286N/Aimport org.w3c.dom.Node;
286N/Aimport org.w3c.dom.NodeList;
286N/Aimport org.w3c.dom.ProcessingInstruction;
286N/Aimport org.w3c.dom.Text;
286N/A
286N/Aimport org.w3c.dom.UserDataHandler;
286N/Aimport org.w3c.dom.DOMConfiguration;
286N/Aimport org.w3c.dom.TypeInfo;
286N/A/**
286N/A * <meta name="usage" content="internal"/>
286N/A * To be subclassed by classes that wish to fake being nodes.
286N/A */
286N/Apublic class UnImplNode implements Node, Element, NodeList, Document
286N/A{
286N/A
286N/A /**
286N/A * Constructor UnImplNode
286N/A *
286N/A */
286N/A public UnImplNode(){}
286N/A
286N/A /**
286N/A * Throw an error.
286N/A *
286N/A * @param msg Message Key for the error
286N/A */
286N/A public void error(String msg)
286N/A {
286N/A
286N/A System.out.println("DOM ERROR! class: " + this.getClass().getName());
286N/A
286N/A throw new RuntimeException(XMLMessages.createXMLMessage(msg, null));
286N/A }
286N/A
286N/A /**
286N/A * Throw an error.
286N/A *
286N/A * @param msg Message Key for the error
286N/A * @param args Array of arguments to be used in the error message
286N/A */
286N/A public void error(String msg, Object[] args)
286N/A {
286N/A
286N/A System.out.println("DOM ERROR! class: " + this.getClass().getName());
286N/A
286N/A throw new RuntimeException(XMLMessages.createXMLMessage(msg, args)); //"UnImplNode error: "+msg);
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Node
286N/A *
286N/A * @param newChild New node to append to the list of this node's children
286N/A *
286N/A * @return null
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public Node appendChild(Node newChild) throws DOMException
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"appendChild not supported!");
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Node
286N/A *
286N/A * @return false
286N/A */
286N/A public boolean hasChildNodes()
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"hasChildNodes not supported!");
286N/A
286N/A return false;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Node
286N/A *
286N/A * @return 0
286N/A */
286N/A public short getNodeType()
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getNodeType not supported!");
286N/A
286N/A return 0;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Node
286N/A *
286N/A * @return null
286N/A */
286N/A public Node getParentNode()
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getParentNode not supported!");
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Node
286N/A *
286N/A * @return null
286N/A */
286N/A public NodeList getChildNodes()
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getChildNodes not supported!");
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Node
286N/A *
286N/A * @return null
286N/A */
286N/A public Node getFirstChild()
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getFirstChild not supported!");
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Node
286N/A *
286N/A * @return null
286N/A */
286N/A public Node getLastChild()
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getLastChild not supported!");
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Node
286N/A *
286N/A * @return null
286N/A */
286N/A public Node getNextSibling()
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getNextSibling not supported!");
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.NodeList
286N/A *
286N/A * @return 0
286N/A */
286N/A public int getLength()
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getLength not supported!");
286N/A
286N/A return 0;
286N/A } // getLength():int
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.NodeList
286N/A *
286N/A * @param index index of a child of this node in its list of children
286N/A *
286N/A * @return null
286N/A */
286N/A public Node item(int index)
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"item not supported!");
286N/A
286N/A return null;
286N/A } // item(int):Node
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Node
286N/A *
286N/A * @return null
286N/A */
286N/A public Document getOwnerDocument()
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getOwnerDocument not supported!");
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Node
286N/A *
286N/A * @return null
286N/A */
286N/A public String getTagName()
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getTagName not supported!");
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Node
286N/A *
286N/A * @return null
286N/A */
286N/A public String getNodeName()
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getNodeName not supported!");
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /** Unimplemented. See org.w3c.dom.Node */
286N/A public void normalize()
286N/A {
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"normalize not supported!");
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Element
286N/A *
286N/A * @param name Name of the element
286N/A *
286N/A * @return null
286N/A */
286N/A public NodeList getElementsByTagName(String name)
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getElementsByTagName not supported!");
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Element
286N/A *
286N/A * @param oldAttr Attribute to be removed from this node's list of attributes
286N/A *
286N/A * @return null
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public Attr removeAttributeNode(Attr oldAttr) throws DOMException
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"removeAttributeNode not supported!");
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Element
286N/A *
286N/A * @param newAttr Attribute node to be added to this node's list of attributes
286N/A *
286N/A * @return null
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public Attr setAttributeNode(Attr newAttr) throws DOMException
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setAttributeNode not supported!");
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Element
286N/A *
286N/A *
286N/A * @param name Name of an attribute
286N/A *
286N/A * @return false
286N/A */
286N/A public boolean hasAttribute(String name)
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"hasAttribute not supported!");
286N/A
286N/A return false;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Element
286N/A *
286N/A *
286N/A * @param name
286N/A * @param x
286N/A *
286N/A * @return false
286N/A */
286N/A public boolean hasAttributeNS(String name, String x)
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"hasAttributeNS not supported!");
286N/A
286N/A return false;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Element
286N/A *
286N/A *
286N/A * @param name Attribute node name
286N/A *
286N/A * @return null
286N/A */
286N/A public Attr getAttributeNode(String name)
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getAttributeNode not supported!");
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Element
286N/A *
286N/A * @param name Attribute node name to remove from list of attributes
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public void removeAttribute(String name) throws DOMException
286N/A {
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"removeAttribute not supported!");
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Element
286N/A *
286N/A * @param name Name of attribute to set
286N/A * @param value Value of attribute
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public void setAttribute(String name, String value) throws DOMException
286N/A {
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setAttribute not supported!");
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Element
286N/A *
286N/A * @param name Name of attribute to get
286N/A *
286N/A * @return null
286N/A */
286N/A public String getAttribute(String name)
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getAttribute not supported!");
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. Introduced in DOM Level 2.
286N/A *
286N/A * @return false
286N/A */
286N/A public boolean hasAttributes()
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"hasAttributes not supported!");
286N/A
286N/A return false;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Element
286N/A *
286N/A * @param namespaceURI Namespace URI of the element
286N/A * @param localName Local part of qualified name of the element
286N/A *
286N/A * @return null
286N/A */
286N/A public NodeList getElementsByTagNameNS(String namespaceURI,
286N/A String localName)
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getElementsByTagNameNS not supported!");
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Element
286N/A *
286N/A * @param newAttr Attribute to set
286N/A *
286N/A * @return null
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public Attr setAttributeNodeNS(Attr newAttr) throws DOMException
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setAttributeNodeNS not supported!");
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Element
286N/A *
286N/A * @param namespaceURI Namespace URI of attribute node to get
286N/A * @param localName Local part of qualified name of attribute node to get
286N/A *
286N/A * @return null
286N/A */
286N/A public Attr getAttributeNodeNS(String namespaceURI, String localName)
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getAttributeNodeNS not supported!");
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Element
286N/A *
286N/A * @param namespaceURI Namespace URI of attribute node to remove
286N/A * @param localName Local part of qualified name of attribute node to remove
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public void removeAttributeNS(String namespaceURI, String localName)
286N/A throws DOMException
286N/A {
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"removeAttributeNS not supported!");
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Element
286N/A *
286N/A * @param namespaceURI Namespace URI of attribute node to set
286N/A * @param qualifiedName qualified name of attribute
286N/A * @param value value of attribute
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public void setAttributeNS(
286N/A String namespaceURI, String qualifiedName, String value)
286N/A throws DOMException
286N/A {
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setAttributeNS not supported!");
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Element
286N/A *
286N/A * @param namespaceURI Namespace URI of attribute node to get
286N/A * @param localName Local part of qualified name of attribute node to get
286N/A *
286N/A * @return null
286N/A */
286N/A public String getAttributeNS(String namespaceURI, String localName)
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getAttributeNS not supported!");
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Node
286N/A *
286N/A * @return null
286N/A */
286N/A public Node getPreviousSibling()
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getPreviousSibling not supported!");
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Node
286N/A *
286N/A * @param deep Flag indicating whether to clone deep (clone member variables)
286N/A *
286N/A * @return null
286N/A */
286N/A public Node cloneNode(boolean deep)
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"cloneNode not supported!");
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Node
286N/A *
286N/A * @return null
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public String getNodeValue() throws DOMException
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getNodeValue not supported!");
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Node
286N/A *
286N/A * @param nodeValue Value to set this node to
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public void setNodeValue(String nodeValue) throws DOMException
286N/A {
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setNodeValue not supported!");
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Node
286N/A *
286N/A *
286N/A * NEEDSDOC @param value
286N/A * @return value Node value
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A
286N/A // public String getValue ()
286N/A // {
286N/A // error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getValue not supported!");
286N/A // return null;
286N/A // }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Node
286N/A *
286N/A * @param value Value to set this node to
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public void setValue(String value) throws DOMException
286N/A {
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setValue not supported!");
286N/A }
286N/A
286N/A /**
286N/A * Returns the name of this attribute.
286N/A *
286N/A * @return the name of this attribute.
286N/A */
286N/A
286N/A // public String getName()
286N/A // {
286N/A // return this.getNodeName();
286N/A // }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Node
286N/A *
286N/A * @return null
286N/A */
286N/A public Element getOwnerElement()
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getOwnerElement not supported!");
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Node
286N/A *
286N/A * @return False
286N/A */
286N/A public boolean getSpecified()
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setValue not supported!");
286N/A
286N/A return false;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Node
286N/A *
286N/A * @return null
286N/A */
286N/A public NamedNodeMap getAttributes()
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getAttributes not supported!");
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Node
286N/A *
286N/A * @param newChild New child node to insert
286N/A * @param refChild Insert in front of this child
286N/A *
286N/A * @return null
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public Node insertBefore(Node newChild, Node refChild) throws DOMException
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"insertBefore not supported!");
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Node
286N/A *
286N/A * @param newChild Replace existing child with this one
286N/A * @param oldChild Existing child to be replaced
286N/A *
286N/A * @return null
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public Node replaceChild(Node newChild, Node oldChild) throws DOMException
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"replaceChild not supported!");
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Node
286N/A *
286N/A * @param oldChild Child to be removed
286N/A *
286N/A * @return null
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public Node removeChild(Node oldChild) throws DOMException
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"replaceChild not supported!");
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Tests whether the DOM implementation implements a specific feature and
286N/A * that feature is supported by this node.
286N/A * @param feature The name of the feature to test. This is the same name
286N/A * which can be passed to the method <code>hasFeature</code> on
286N/A * <code>DOMImplementation</code>.
286N/A * @param version This is the version number of the feature to test. In
286N/A * Level 2, version 1, this is the string "2.0". If the version is not
286N/A * specified, supporting any version of the feature will cause the
286N/A * method to return <code>true</code>.
286N/A *
286N/A * @return Returns <code>false</code>
286N/A * @since DOM Level 2
286N/A */
286N/A public boolean isSupported(String feature, String version)
286N/A {
286N/A return false;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Node
286N/A *
286N/A * @return null
286N/A */
286N/A public String getNamespaceURI()
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getNamespaceURI not supported!");
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Node
286N/A *
286N/A * @return null
286N/A */
286N/A public String getPrefix()
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getPrefix not supported!");
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Node
286N/A *
286N/A * @param prefix Prefix to set for this node
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public void setPrefix(String prefix) throws DOMException
286N/A {
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"setPrefix not supported!");
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Node
286N/A *
286N/A * @return null
286N/A */
286N/A public String getLocalName()
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED); //"getLocalName not supported!");
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Document
286N/A *
286N/A * @return null
286N/A */
286N/A public DocumentType getDoctype()
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Document
286N/A *
286N/A * @return null
286N/A */
286N/A public DOMImplementation getImplementation()
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Document
286N/A *
286N/A * @return null
286N/A */
286N/A public Element getDocumentElement()
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Document
286N/A *
286N/A * @param tagName Element tag name
286N/A *
286N/A * @return null
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public Element createElement(String tagName) throws DOMException
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Document
286N/A *
286N/A * @return null
286N/A */
286N/A public DocumentFragment createDocumentFragment()
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Document
286N/A *
286N/A * @param data Data for text node
286N/A *
286N/A * @return null
286N/A */
286N/A public Text createTextNode(String data)
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Document
286N/A *
286N/A * @param data Data for comment
286N/A *
286N/A * @return null
286N/A */
286N/A public Comment createComment(String data)
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Document
286N/A *
286N/A * @param data Data for CDATA section
286N/A *
286N/A * @return null
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public CDATASection createCDATASection(String data) throws DOMException
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Document
286N/A *
286N/A * @param target Target for Processing instruction
286N/A * @param data Data for Processing instruction
286N/A *
286N/A * @return null
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public ProcessingInstruction createProcessingInstruction(
286N/A String target, String data) throws DOMException
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Document
286N/A *
286N/A * @param name Attribute name
286N/A *
286N/A * @return null
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public Attr createAttribute(String name) throws DOMException
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Document
286N/A *
286N/A * @param name Entity Reference name
286N/A *
286N/A * @return null
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public EntityReference createEntityReference(String name)
286N/A throws DOMException
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Document
286N/A *
286N/A * @param importedNode The node to import.
286N/A * @param deep If <code>true</code>, recursively import the subtree under
286N/A * the specified node; if <code>false</code>, import only the node
286N/A * itself, as explained above. This has no effect on <code>Attr</code>
286N/A * , <code>EntityReference</code>, and <code>Notation</code> nodes.
286N/A *
286N/A * @return null
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public Node importNode(Node importedNode, boolean deep) throws DOMException
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Document
286N/A *
286N/A * @param namespaceURI Namespace URI for the element
286N/A * @param qualifiedName Qualified name of the element
286N/A *
286N/A * @return null
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public Element createElementNS(String namespaceURI, String qualifiedName)
286N/A throws DOMException
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Document
286N/A *
286N/A * @param namespaceURI Namespace URI of the attribute
286N/A * @param qualifiedName Qualified name of the attribute
286N/A *
286N/A * @return null
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public Attr createAttributeNS(String namespaceURI, String qualifiedName)
286N/A throws DOMException
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented. See org.w3c.dom.Document
286N/A *
286N/A * @param elementId ID of the element to get
286N/A *
286N/A * @return null
286N/A */
286N/A public Element getElementById(String elementId)
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Set Node data
286N/A *
286N/A *
286N/A * @param data data to set for this node
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public void setData(String data) throws DOMException
286N/A {
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented.
286N/A *
286N/A * @param offset Start offset of substring to extract.
286N/A * @param count The length of the substring to extract.
286N/A *
286N/A * @return null
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public String substringData(int offset, int count) throws DOMException
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented.
286N/A *
286N/A * @param arg String data to append
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public void appendData(String arg) throws DOMException
286N/A {
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented.
286N/A *
286N/A * @param offset Start offset of substring to insert.
286N/A * @param arg The (sub)string to insert.
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public void insertData(int offset, String arg) throws DOMException
286N/A {
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented.
286N/A *
286N/A * @param offset Start offset of substring to delete.
286N/A * @param count The length of the substring to delete.
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public void deleteData(int offset, int count) throws DOMException
286N/A {
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented.
286N/A *
286N/A * @param offset Start offset of substring to replace.
286N/A * @param count The length of the substring to replace.
286N/A * @param arg substring to replace with
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public void replaceData(int offset, int count, String arg)
286N/A throws DOMException
286N/A {
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A }
286N/A
286N/A /**
286N/A * Unimplemented.
286N/A *
286N/A * @param offset Offset into text to split
286N/A *
286N/A * @return null, unimplemented
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public Text splitText(int offset) throws DOMException
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * NEEDSDOC Method adoptNode
286N/A *
286N/A *
286N/A * NEEDSDOC @param source
286N/A *
286N/A * NEEDSDOC (adoptNode) @return
286N/A *
286N/A * @throws DOMException
286N/A */
286N/A public Node adoptNode(Node source) throws DOMException
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * <p>EXPERIMENTAL! Based on the <a
286N/A * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
286N/A * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
286N/A * <p>
286N/A * An attribute specifying, as part of the XML declaration, the encoding
286N/A * of this document. This is <code>null</code> when unspecified.
286N/A * @since DOM Level 3
286N/A *
286N/A * NEEDSDOC ($objectName$) @return
286N/A */
286N/A public String getInputEncoding()
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * <p>EXPERIMENTAL! Based on the <a
286N/A * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
286N/A * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
286N/A * <p>
286N/A * An attribute specifying, as part of the XML declaration, the encoding
286N/A * of this document. This is <code>null</code> when unspecified.
286N/A * @since DOM Level 3
286N/A *
286N/A * NEEDSDOC @param encoding
286N/A */
286N/A public void setInputEncoding(String encoding)
286N/A {
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A }
286N/A
286N/A /**
286N/A * <p>EXPERIMENTAL! Based on the <a
286N/A * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
286N/A * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
286N/A * <p>
286N/A * An attribute specifying, as part of the XML declaration, whether this
286N/A * document is standalone.
286N/A * @since DOM Level 3
286N/A *
286N/A * NEEDSDOC ($objectName$) @return
286N/A */
286N/A public boolean getStandalone()
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A
286N/A return false;
286N/A }
286N/A
286N/A /**
286N/A * <p>EXPERIMENTAL! Based on the <a
286N/A * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
286N/A * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
286N/A * <p>
286N/A * An attribute specifying, as part of the XML declaration, whether this
286N/A * document is standalone.
286N/A * @since DOM Level 3
286N/A *
286N/A * NEEDSDOC @param standalone
286N/A */
286N/A public void setStandalone(boolean standalone)
286N/A {
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A }
286N/A
286N/A /**
286N/A * <p>EXPERIMENTAL! Based on the <a
286N/A * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
286N/A * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
286N/A * <p>
286N/A * An attribute specifying whether errors checking is enforced or not.
286N/A * When set to <code>false</code>, the implementation is free to not
286N/A * test every possible error case normally defined on DOM operations,
286N/A * and not raise any <code>DOMException</code>. In case of error, the
286N/A * behavior is undefined. This attribute is <code>true</code> by
286N/A * defaults.
286N/A * @since DOM Level 3
286N/A *
286N/A * NEEDSDOC ($objectName$) @return
286N/A */
286N/A public boolean getStrictErrorChecking()
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A
286N/A return false;
286N/A }
286N/A
286N/A /**
286N/A * <p>EXPERIMENTAL! Based on the <a
286N/A * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
286N/A * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
286N/A * <p>
286N/A * An attribute specifying whether errors checking is enforced or not.
286N/A * When set to <code>false</code>, the implementation is free to not
286N/A * test every possible error case normally defined on DOM operations,
286N/A * and not raise any <code>DOMException</code>. In case of error, the
286N/A * behavior is undefined. This attribute is <code>true</code> by
286N/A * defaults.
286N/A * @since DOM Level 3
286N/A *
286N/A * NEEDSDOC @param strictErrorChecking
286N/A */
286N/A public void setStrictErrorChecking(boolean strictErrorChecking)
286N/A {
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A }
286N/A
286N/A /**
286N/A * <p>EXPERIMENTAL! Based on the <a
286N/A * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
286N/A * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
286N/A * <p>
286N/A * An attribute specifying, as part of the XML declaration, the version
286N/A * number of this document. This is <code>null</code> when unspecified.
286N/A * @since DOM Level 3
286N/A *
286N/A * NEEDSDOC ($objectName$) @return
286N/A */
286N/A public String getVersion()
286N/A {
286N/A
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * <p>EXPERIMENTAL! Based on the <a
286N/A * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document
286N/A * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.
286N/A * <p>
286N/A * An attribute specifying, as part of the XML declaration, the version
286N/A * number of this document. This is <code>null</code> when unspecified.
286N/A * @since DOM Level 3
286N/A *
286N/A * NEEDSDOC @param version
286N/A */
286N/A public void setVersion(String version)
286N/A {
286N/A error(XMLErrorResources.ER_FUNCTION_NOT_SUPPORTED);
286N/A }
286N/A
286N/A
286N/A
286N/A//RAMESH : Pending proper implementation of DOM Level 3
286N/A
286N/A public Object setUserData(String key,
286N/A Object data,
286N/A UserDataHandler handler) {
286N/A return getOwnerDocument().setUserData( key, data, handler);
286N/A }
286N/A
286N/A /**
286N/A * Retrieves the object associated to a key on a this node. The object
286N/A * must first have been set to this node by calling
286N/A * <code>setUserData</code> with the same key.
286N/A * @param key The key the object is associated to.
286N/A * @return Returns the <code>DOMObject</code> associated to the given key
286N/A * on this node, or <code>null</code> if there was none.
286N/A * @since DOM Level 3
286N/A */
286N/A public Object getUserData(String key) {
286N/A return getOwnerDocument().getUserData( key);
286N/A }
286N/A
286N/A /**
286N/A * This method returns a specialized object which implements the
286N/A * specialized APIs of the specified feature and version. The
286N/A * specialized object may also be obtained by using binding-specific
286N/A * casting methods but is not necessarily expected to, as discussed in Mixed DOM implementations.
286N/A * @param feature The name of the feature requested (case-insensitive).
286N/A * @param version This is the version number of the feature to test. If
286N/A * the version is <code>null</code> or the empty string, supporting
286N/A * any version of the feature will cause the method to return an
286N/A * object that supports at least one version of the feature.
286N/A * @return Returns an object which implements the specialized APIs of
286N/A * the specified feature and version, if any, or <code>null</code> if
286N/A * there is no object which implements interfaces associated with that
286N/A * feature. If the <code>DOMObject</code> returned by this method
286N/A * implements the <code>Node</code> interface, it must delegate to the
286N/A * primary core <code>Node</code> and not return results inconsistent
286N/A * with the primary core <code>Node</code> such as attributes,
286N/A * childNodes, etc.
286N/A * @since DOM Level 3
286N/A */
286N/A public Object getFeature(String feature, String version) {
286N/A // we don't have any alternate node, either this node does the job
286N/A // or we don't have anything that does
286N/A return isSupported(feature, version) ? this : null;
286N/A }
286N/A
286N/A /**
286N/A * Tests whether two nodes are equal.
286N/A * <br>This method tests for equality of nodes, not sameness (i.e.,
286N/A * whether the two nodes are references to the same object) which can be
286N/A * tested with <code>Node.isSameNode</code>. All nodes that are the same
286N/A * will also be equal, though the reverse may not be true.
286N/A * <br>Two nodes are equal if and only if the following conditions are
286N/A * satisfied: The two nodes are of the same type.The following string
286N/A * attributes are equal: <code>nodeName</code>, <code>localName</code>,
286N/A * <code>namespaceURI</code>, <code>prefix</code>, <code>nodeValue</code>
286N/A * , <code>baseURI</code>. This is: they are both <code>null</code>, or
286N/A * they have the same length and are character for character identical.
286N/A * The <code>attributes</code> <code>NamedNodeMaps</code> are equal.
286N/A * This is: they are both <code>null</code>, or they have the same
286N/A * length and for each node that exists in one map there is a node that
286N/A * exists in the other map and is equal, although not necessarily at the
286N/A * same index.The <code>childNodes</code> <code>NodeLists</code> are
286N/A * equal. This is: they are both <code>null</code>, or they have the
286N/A * same length and contain equal nodes at the same index. This is true
286N/A * for <code>Attr</code> nodes as for any other type of node. Note that
286N/A * normalization can affect equality; to avoid this, nodes should be
286N/A * normalized before being compared.
286N/A * <br>For two <code>DocumentType</code> nodes to be equal, the following
286N/A * conditions must also be satisfied: The following string attributes
286N/A * are equal: <code>publicId</code>, <code>systemId</code>,
286N/A * <code>internalSubset</code>.The <code>entities</code>
286N/A * <code>NamedNodeMaps</code> are equal.The <code>notations</code>
286N/A * <code>NamedNodeMaps</code> are equal.
286N/A * <br>On the other hand, the following do not affect equality: the
286N/A * <code>ownerDocument</code> attribute, the <code>specified</code>
286N/A * attribute for <code>Attr</code> nodes, the
286N/A * <code>isWhitespaceInElementContent</code> attribute for
286N/A * <code>Text</code> nodes, as well as any user data or event listeners
286N/A * registered on the nodes.
286N/A *
286N/A * @param arg The node to compare equality with.
286N/A * @return If the nodes, and possibly subtrees are equal,
286N/A * <code>true</code> otherwise <code>false</code>.
286N/A * @since DOM Level 3
286N/A */
286N/A public boolean isEqualNode(Node arg) {
286N/A if (arg == this) {
286N/A return true;
286N/A }
286N/A if (arg.getNodeType() != getNodeType()) {
286N/A return false;
286N/A }
286N/A // in theory nodeName can't be null but better be careful
286N/A // who knows what other implementations may be doing?...
286N/A if (getNodeName() == null) {
286N/A if (arg.getNodeName() != null) {
286N/A return false;
286N/A }
286N/A }
286N/A else if (!getNodeName().equals(arg.getNodeName())) {
286N/A return false;
286N/A }
286N/A
286N/A if (getLocalName() == null) {
286N/A if (arg.getLocalName() != null) {
286N/A return false;
286N/A }
286N/A }
286N/A else if (!getLocalName().equals(arg.getLocalName())) {
286N/A return false;
286N/A }
286N/A
286N/A if (getNamespaceURI() == null) {
286N/A if (arg.getNamespaceURI() != null) {
286N/A return false;
286N/A }
286N/A }
286N/A else if (!getNamespaceURI().equals(arg.getNamespaceURI())) {
286N/A return false;
286N/A }
286N/A
286N/A if (getPrefix() == null) {
286N/A if (arg.getPrefix() != null) {
286N/A return false;
286N/A }
286N/A }
286N/A else if (!getPrefix().equals(arg.getPrefix())) {
286N/A return false;
286N/A }
286N/A
286N/A if (getNodeValue() == null) {
286N/A if (arg.getNodeValue() != null) {
286N/A return false;
286N/A }
286N/A }
286N/A else if (!getNodeValue().equals(arg.getNodeValue())) {
286N/A return false;
286N/A }
286N/A /*
286N/A if (getBaseURI() == null) {
286N/A if (((NodeImpl) arg).getBaseURI() != null) {
286N/A return false;
286N/A }
286N/A }
286N/A else if (!getBaseURI().equals(((NodeImpl) arg).getBaseURI())) {
286N/A return false;
286N/A }
286N/A*/
286N/A
286N/A return true;
286N/A }
286N/A
286N/A /**
286N/A * DOM Level 3 - Experimental:
286N/A * Look up the namespace URI associated to the given prefix, starting from this node.
286N/A * Use lookupNamespaceURI(null) to lookup the default namespace
286N/A *
286N/A * @param namespaceURI
286N/A * @return th URI for the namespace
286N/A * @since DOM Level 3
286N/A */
286N/A public String lookupNamespaceURI(String specifiedPrefix) {
286N/A short type = this.getNodeType();
286N/A switch (type) {
286N/A case Node.ELEMENT_NODE : {
286N/A
286N/A String namespace = this.getNamespaceURI();
286N/A String prefix = this.getPrefix();
286N/A if (namespace !=null) {
286N/A // REVISIT: is it possible that prefix is empty string?
286N/A if (specifiedPrefix== null && prefix==specifiedPrefix) {
286N/A // looking for default namespace
286N/A return namespace;
286N/A } else if (prefix != null && prefix.equals(specifiedPrefix)) {
286N/A // non default namespace
286N/A return namespace;
286N/A }
286N/A }
286N/A if (this.hasAttributes()) {
286N/A NamedNodeMap map = this.getAttributes();
286N/A int length = map.getLength();
286N/A for (int i=0;i<length;i++) {
286N/A Node attr = map.item(i);
286N/A String attrPrefix = attr.getPrefix();
286N/A String value = attr.getNodeValue();
286N/A namespace = attr.getNamespaceURI();
286N/A if (namespace !=null && namespace.equals("http://www.w3.org/2000/xmlns/")) {
286N/A // at this point we are dealing with DOM Level 2 nodes only
286N/A if (specifiedPrefix == null &&
286N/A attr.getNodeName().equals("xmlns")) {
286N/A // default namespace
286N/A return value;
286N/A } else if (attrPrefix !=null &&
286N/A attrPrefix.equals("xmlns") &&
286N/A attr.getLocalName().equals(specifiedPrefix)) {
286N/A // non default namespace
286N/A return value;
286N/A }
286N/A }
286N/A }
286N/A }
286N/A /*
286N/A NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
286N/A if (ancestor != null) {
286N/A return ancestor.lookupNamespaceURI(specifiedPrefix);
286N/A }
286N/A */
286N/A
286N/A return null;
286N/A
286N/A
286N/A }
286N/A/*
286N/A case Node.DOCUMENT_NODE : {
286N/A return((NodeImpl)((Document)this).getDocumentElement()).lookupNamespaceURI(specifiedPrefix) ;
286N/A }
286N/A*/
286N/A case Node.ENTITY_NODE :
286N/A case Node.NOTATION_NODE:
286N/A case Node.DOCUMENT_FRAGMENT_NODE:
286N/A case Node.DOCUMENT_TYPE_NODE:
286N/A // type is unknown
286N/A return null;
286N/A case Node.ATTRIBUTE_NODE:{
286N/A if (this.getOwnerElement().getNodeType() == Node.ELEMENT_NODE) {
286N/A return getOwnerElement().lookupNamespaceURI(specifiedPrefix);
286N/A
286N/A }
286N/A return null;
286N/A }
286N/A default:{
286N/A /*
286N/A NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
286N/A if (ancestor != null) {
286N/A return ancestor.lookupNamespaceURI(specifiedPrefix);
286N/A }
286N/A */
286N/A return null;
286N/A }
286N/A
286N/A }
286N/A }
286N/A
286N/A
286N/A /**
286N/A * DOM Level 3: Experimental
286N/A * This method checks if the specified <code>namespaceURI</code> is the
286N/A * default namespace or not.
286N/A * @param namespaceURI The namespace URI to look for.
286N/A * @return <code>true</code> if the specified <code>namespaceURI</code>
286N/A * is the default namespace, <code>false</code> otherwise.
286N/A * @since DOM Level 3
286N/A */
286N/A public boolean isDefaultNamespace(String namespaceURI){
286N/A /*
286N/A // REVISIT: remove casts when DOM L3 becomes REC.
286N/A short type = this.getNodeType();
286N/A switch (type) {
286N/A case Node.ELEMENT_NODE: {
286N/A String namespace = this.getNamespaceURI();
286N/A String prefix = this.getPrefix();
286N/A
286N/A // REVISIT: is it possible that prefix is empty string?
286N/A if (prefix == null || prefix.length() == 0) {
286N/A if (namespaceURI == null) {
286N/A return (namespace == namespaceURI);
286N/A }
286N/A return namespaceURI.equals(namespace);
286N/A }
286N/A if (this.hasAttributes()) {
286N/A ElementImpl elem = (ElementImpl)this;
286N/A NodeImpl attr = (NodeImpl)elem.getAttributeNodeNS("http://www.w3.org/2000/xmlns/", "xmlns");
286N/A if (attr != null) {
286N/A String value = attr.getNodeValue();
286N/A if (namespaceURI == null) {
286N/A return (namespace == value);
286N/A }
286N/A return namespaceURI.equals(value);
286N/A }
286N/A }
286N/A
286N/A NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
286N/A if (ancestor != null) {
286N/A return ancestor.isDefaultNamespace(namespaceURI);
286N/A }
286N/A return false;
286N/A }
286N/A case Node.DOCUMENT_NODE:{
286N/A return((NodeImpl)((Document)this).getDocumentElement()).isDefaultNamespace(namespaceURI);
286N/A }
286N/A
286N/A case Node.ENTITY_NODE :
286N/A case Node.NOTATION_NODE:
286N/A case Node.DOCUMENT_FRAGMENT_NODE:
286N/A case Node.DOCUMENT_TYPE_NODE:
286N/A // type is unknown
286N/A return false;
286N/A case Node.ATTRIBUTE_NODE:{
286N/A if (this.ownerNode.getNodeType() == Node.ELEMENT_NODE) {
286N/A return ownerNode.isDefaultNamespace(namespaceURI);
286N/A
286N/A }
286N/A return false;
286N/A }
286N/A default:{
286N/A NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
286N/A if (ancestor != null) {
286N/A return ancestor.isDefaultNamespace(namespaceURI);
286N/A }
286N/A return false;
286N/A }
286N/A
286N/A }
286N/A*/
286N/A return false;
286N/A
286N/A
286N/A }
286N/A
286N/A /**
286N/A *
286N/A * DOM Level 3 - Experimental:
286N/A * Look up the prefix associated to the given namespace URI, starting from this node.
286N/A *
286N/A * @param namespaceURI
286N/A * @return the prefix for the namespace
286N/A */
286N/A public String lookupPrefix(String namespaceURI){
286N/A
286N/A // REVISIT: When Namespaces 1.1 comes out this may not be true
286N/A // Prefix can't be bound to null namespace
286N/A if (namespaceURI == null) {
286N/A return null;
286N/A }
286N/A
286N/A short type = this.getNodeType();
286N/A
286N/A switch (type) {
286N/A/*
286N/A case Node.ELEMENT_NODE: {
286N/A
286N/A String namespace = this.getNamespaceURI(); // to flip out children
286N/A return lookupNamespacePrefix(namespaceURI, (ElementImpl)this);
286N/A }
286N/A
286N/A case Node.DOCUMENT_NODE:{
286N/A return((NodeImpl)((Document)this).getDocumentElement()).lookupPrefix(namespaceURI);
286N/A }
286N/A*/
286N/A case Node.ENTITY_NODE :
286N/A case Node.NOTATION_NODE:
286N/A case Node.DOCUMENT_FRAGMENT_NODE:
286N/A case Node.DOCUMENT_TYPE_NODE:
286N/A // type is unknown
286N/A return null;
286N/A case Node.ATTRIBUTE_NODE:{
286N/A if (this.getOwnerElement().getNodeType() == Node.ELEMENT_NODE) {
286N/A return getOwnerElement().lookupPrefix(namespaceURI);
286N/A
286N/A }
286N/A return null;
286N/A }
286N/A default:{
286N/A/*
286N/A NodeImpl ancestor = (NodeImpl)getElementAncestor(this);
286N/A if (ancestor != null) {
286N/A return ancestor.lookupPrefix(namespaceURI);
286N/A }
286N/A*/
286N/A return null;
286N/A }
286N/A }
286N/A }
286N/A
286N/A /**
286N/A * Returns whether this node is the same node as the given one.
286N/A * <br>This method provides a way to determine whether two
286N/A * <code>Node</code> references returned by the implementation reference
286N/A * the same object. When two <code>Node</code> references are references
286N/A * to the same object, even if through a proxy, the references may be
286N/A * used completely interchangably, such that all attributes have the
286N/A * same values and calling the same DOM method on either reference
286N/A * always has exactly the same effect.
286N/A * @param other The node to test against.
286N/A * @return Returns <code>true</code> if the nodes are the same,
286N/A * <code>false</code> otherwise.
286N/A * @since DOM Level 3
286N/A */
286N/A public boolean isSameNode(Node other) {
286N/A // we do not use any wrapper so the answer is obvious
286N/A return this == other;
286N/A }
286N/A
286N/A /**
286N/A * This attribute returns the text content of this node and its
286N/A * descendants. When it is defined to be null, setting it has no effect.
286N/A * When set, any possible children this node may have are removed and
286N/A * replaced by a single <code>Text</code> node containing the string
286N/A * this attribute is set to. On getting, no serialization is performed,
286N/A * the returned string does not contain any markup. No whitespace
286N/A * normalization is performed, the returned string does not contain the
286N/A * element content whitespaces . Similarly, on setting, no parsing is
286N/A * performed either, the input string is taken as pure textual content.
286N/A * <br>The string returned is made of the text content of this node
286N/A * depending on its type, as defined below:
286N/A * <table border='1'>
286N/A * <tr>
286N/A * <th>Node type</th>
286N/A * <th>Content</th>
286N/A * </tr>
286N/A * <tr>
286N/A * <td valign='top' rowspan='1' colspan='1'>
286N/A * ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE,
286N/A * DOCUMENT_FRAGMENT_NODE</td>
286N/A * <td valign='top' rowspan='1' colspan='1'>concatenation of the <code>textContent</code>
286N/A * attribute value of every child node, excluding COMMENT_NODE and
286N/A * PROCESSING_INSTRUCTION_NODE nodes</td>
286N/A * </tr>
286N/A * <tr>
286N/A * <td valign='top' rowspan='1' colspan='1'>ATTRIBUTE_NODE, TEXT_NODE,
286N/A * CDATA_SECTION_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE</td>
286N/A * <td valign='top' rowspan='1' colspan='1'>
286N/A * <code>nodeValue</code></td>
286N/A * </tr>
286N/A * <tr>
286N/A * <td valign='top' rowspan='1' colspan='1'>DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE</td>
286N/A * <td valign='top' rowspan='1' colspan='1'>
286N/A * null</td>
286N/A * </tr>
286N/A * </table>
286N/A * @exception DOMException
286N/A * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
286N/A * @exception DOMException
286N/A * DOMSTRING_SIZE_ERR: Raised when it would return more characters than
286N/A * fit in a <code>DOMString</code> variable on the implementation
286N/A * platform.
286N/A * @since DOM Level 3
286N/A */
286N/A public void setTextContent(String textContent)
286N/A throws DOMException {
286N/A setNodeValue(textContent);
286N/A }
286N/A /**
286N/A * This attribute returns the text content of this node and its
286N/A * descendants. When it is defined to be null, setting it has no effect.
286N/A * When set, any possible children this node may have are removed and
286N/A * replaced by a single <code>Text</code> node containing the string
286N/A * this attribute is set to. On getting, no serialization is performed,
286N/A * the returned string does not contain any markup. No whitespace
286N/A * normalization is performed, the returned string does not contain the
286N/A * element content whitespaces . Similarly, on setting, no parsing is
286N/A * performed either, the input string is taken as pure textual content.
286N/A * <br>The string returned is made of the text content of this node
286N/A * depending on its type, as defined below:
286N/A * <table border='1'>
286N/A * <tr>
286N/A * <th>Node type</th>
286N/A * <th>Content</th>
286N/A * </tr>
286N/A * <tr>
286N/A * <td valign='top' rowspan='1' colspan='1'>
286N/A * ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE,
286N/A * DOCUMENT_FRAGMENT_NODE</td>
286N/A * <td valign='top' rowspan='1' colspan='1'>concatenation of the <code>textContent</code>
286N/A * attribute value of every child node, excluding COMMENT_NODE and
286N/A * PROCESSING_INSTRUCTION_NODE nodes</td>
286N/A * </tr>
286N/A * <tr>
286N/A * <td valign='top' rowspan='1' colspan='1'>ATTRIBUTE_NODE, TEXT_NODE,
286N/A * CDATA_SECTION_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE</td>
286N/A * <td valign='top' rowspan='1' colspan='1'>
286N/A * <code>nodeValue</code></td>
286N/A * </tr>
286N/A * <tr>
286N/A * <td valign='top' rowspan='1' colspan='1'>DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE</td>
286N/A * <td valign='top' rowspan='1' colspan='1'>
286N/A * null</td>
286N/A * </tr>
286N/A * </table>
286N/A * @exception DOMException
286N/A * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
286N/A * @exception DOMException
286N/A * DOMSTRING_SIZE_ERR: Raised when it would return more characters than
286N/A * fit in a <code>DOMString</code> variable on the implementation
286N/A * platform.
286N/A * @since DOM Level 3
286N/A */
286N/A public String getTextContent() throws DOMException {
286N/A return getNodeValue(); // overriden in some subclasses
286N/A }
286N/A
286N/A /**
286N/A * Compares a node with this node with regard to their position in the
286N/A * document.
286N/A * @param other The node to compare against this node.
286N/A * @return Returns how the given node is positioned relatively to this
286N/A * node.
286N/A * @since DOM Level 3
286N/A */
286N/A public short compareDocumentPosition(Node other) throws DOMException {
286N/A return 0;
286N/A }
286N/A
286N/A /**
286N/A * The absolute base URI of this node or <code>null</code> if undefined.
286N/A * This value is computed according to . However, when the
286N/A * <code>Document</code> supports the feature "HTML" , the base URI is
286N/A * computed using first the value of the href attribute of the HTML BASE
286N/A * element if any, and the value of the <code>documentURI</code>
286N/A * attribute from the <code>Document</code> interface otherwise.
286N/A * <br> When the node is an <code>Element</code>, a <code>Document</code>
286N/A * or a a <code>ProcessingInstruction</code>, this attribute represents
286N/A * the properties [base URI] defined in . When the node is a
286N/A * <code>Notation</code>, an <code>Entity</code>, or an
286N/A * <code>EntityReference</code>, this attribute represents the
286N/A * properties [declaration base URI] in the . How will this be affected
286N/A * by resolution of relative namespace URIs issue?It's not.Should this
286N/A * only be on Document, Element, ProcessingInstruction, Entity, and
286N/A * Notation nodes, according to the infoset? If not, what is it equal to
286N/A * on other nodes? Null? An empty string? I think it should be the
286N/A * parent's.No.Should this be read-only and computed or and actual
286N/A * read-write attribute?Read-only and computed (F2F 19 Jun 2000 and
286N/A * teleconference 30 May 2001).If the base HTML element is not yet
286N/A * attached to a document, does the insert change the Document.baseURI?
286N/A * Yes. (F2F 26 Sep 2001)
286N/A * @since DOM Level 3
286N/A */
286N/A public String getBaseURI() {
286N/A return null;
286N/A }
286N/A
286N/A /**
286N/A * DOM Level 3 WD - Experimental.
286N/A * Renaming node
286N/A */
286N/A public Node renameNode(Node n,
286N/A String namespaceURI,
286N/A String name)
286N/A throws DOMException{
286N/A return n;
286N/A }
286N/A
286N/A
286N/A /**
286N/A * DOM Level 3 WD - Experimental
286N/A * Normalize document.
286N/A */
286N/A public void normalizeDocument(){
286N/A
286N/A }
286N/A /**
286N/A * The configuration used when <code>Document.normalizeDocument</code> is
286N/A * invoked.
286N/A * @since DOM Level 3
286N/A */
286N/A public DOMConfiguration getDomConfig(){
286N/A return null;
286N/A }
286N/A
286N/A
286N/A /**Experimental DOM Level 3 feature: documentURI */
286N/A protected String fDocumentURI;
286N/A
286N/A /**
286N/A * DOM Level 3 WD - Experimental.
286N/A */
286N/A public void setDocumentURI(String documentURI){
286N/A
286N/A fDocumentURI= documentURI;
286N/A }
286N/A
286N/A /**
286N/A * DOM Level 3 WD - Experimental.
286N/A * The location of the document or <code>null</code> if undefined.
286N/A * <br>Beware that when the <code>Document</code> supports the feature
286N/A * "HTML" , the href attribute of the HTML BASE element takes precedence
286N/A * over this attribute.
286N/A * @since DOM Level 3
286N/A */
286N/A public String getDocumentURI(){
286N/A return fDocumentURI;
286N/A }
286N/A
286N/A /**Experimental DOM Level 3 feature: Document actualEncoding */
286N/A protected String actualEncoding;
286N/A
286N/A /**
286N/A * DOM Level 3 WD - Experimental.
286N/A * An attribute specifying the actual encoding of this document. This is
286N/A * <code>null</code> otherwise.
286N/A * <br> This attribute represents the property [character encoding scheme]
286N/A * defined in .
286N/A * @since DOM Level 3
286N/A */
286N/A public String getActualEncoding() {
286N/A return actualEncoding;
286N/A }
286N/A
286N/A /**
286N/A * DOM Level 3 WD - Experimental.
286N/A * An attribute specifying the actual encoding of this document. This is
286N/A * <code>null</code> otherwise.
286N/A * <br> This attribute represents the property [character encoding scheme]
286N/A * defined in .
286N/A * @since DOM Level 3
286N/A */
286N/A public void setActualEncoding(String value) {
286N/A actualEncoding = value;
286N/A }
286N/A
286N/A /**
286N/A * DOM Level 3 WD - Experimental.
286N/A */
286N/A public Text replaceWholeText(String content)
286N/A throws DOMException{
286N/A/*
286N/A
286N/A if (needsSyncData()) {
286N/A synchronizeData();
286N/A }
286N/A
286N/A // make sure we can make the replacement
286N/A if (!canModify(nextSibling)) {
286N/A throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR,
286N/A DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null));
286N/A }
286N/A
286N/A Node parent = this.getParentNode();
286N/A if (content == null || content.length() == 0) {
286N/A // remove current node
286N/A if (parent !=null) { // check if node in the tree
286N/A parent.removeChild(this);
286N/A return null;
286N/A }
286N/A }
286N/A Text currentNode = null;
286N/A if (isReadOnly()){
286N/A Text newNode = this.ownerDocument().createTextNode(content);
286N/A if (parent !=null) { // check if node in the tree
286N/A parent.insertBefore(newNode, this);
286N/A parent.removeChild(this);
286N/A currentNode = newNode;
286N/A } else {
286N/A return newNode;
286N/A }
286N/A } else {
286N/A this.setData(content);
286N/A currentNode = this;
286N/A }
286N/A Node sibling = currentNode.getNextSibling();
286N/A while ( sibling !=null) {
286N/A parent.removeChild(sibling);
286N/A sibling = currentNode.getNextSibling();
286N/A }
286N/A
286N/A return currentNode;
286N/A*/
286N/A return null; //Pending
286N/A }
286N/A
286N/A /**
286N/A * DOM Level 3 WD - Experimental.
286N/A * Returns all text of <code>Text</code> nodes logically-adjacent text
286N/A * nodes to this node, concatenated in document order.
286N/A * @since DOM Level 3
286N/A */
286N/A public String getWholeText(){
286N/A
286N/A/*
286N/A if (needsSyncData()) {
286N/A synchronizeData();
286N/A }
286N/A if (nextSibling == null) {
286N/A return data;
286N/A }
286N/A StringBuffer buffer = new StringBuffer();
286N/A if (data != null && data.length() != 0) {
286N/A buffer.append(data);
286N/A }
286N/A getWholeText(nextSibling, buffer);
286N/A return buffer.toString();
286N/A*/
286N/A return null; // PENDING
286N/A
286N/A }
286N/A
286N/A /**
286N/A * DOM Level 3 WD - Experimental.
286N/A * Returns whether this text node contains whitespace in element content,
286N/A * often abusively called "ignorable whitespace".
286N/A */
286N/A public boolean isWhitespaceInElementContent(){
286N/A return false;
286N/A }
286N/A
286N/A
286N/A
286N/A
286N/A /**
286N/A * NON-DOM: set the type of this attribute to be ID type.
286N/A *
286N/A * @param id
286N/A */
286N/A public void setIdAttribute(boolean id){
286N/A //PENDING
286N/A }
286N/A
286N/A /**
286N/A * DOM Level 3: register the given attribute node as an ID attribute
286N/A */
286N/A public void setIdAttribute(String name, boolean makeId) {
286N/A //PENDING
286N/A }
286N/A
286N/A
286N/A /**
286N/A * DOM Level 3: register the given attribute node as an ID attribute
286N/A */
286N/A public void setIdAttributeNode(Attr at, boolean makeId) {
286N/A //PENDING
286N/A }
286N/A
286N/A /**
286N/A * DOM Level 3: register the given attribute node as an ID attribute
286N/A */
286N/A public void setIdAttributeNS(String namespaceURI, String localName,
286N/A boolean makeId) {
286N/A //PENDING
286N/A }
286N/A /**
286N/A * Method getSchemaTypeInfo.
286N/A * @return TypeInfo
286N/A */
286N/A public TypeInfo getSchemaTypeInfo(){
286N/A return null; //PENDING
286N/A }
286N/A
286N/A public boolean isId() {
286N/A return false; //PENDING
286N/A }
286N/A
286N/A private String xmlEncoding;
286N/A public String getXmlEncoding ( ) {
286N/A return xmlEncoding;
286N/A }
286N/A public void setXmlEncoding ( String xmlEncoding ) {
286N/A this.xmlEncoding = xmlEncoding;
286N/A }
286N/A
286N/A private boolean xmlStandalone;
286N/A public boolean getXmlStandalone() {
286N/A return xmlStandalone;
286N/A }
286N/A
286N/A public void setXmlStandalone(boolean xmlStandalone) throws DOMException {
286N/A this.xmlStandalone = xmlStandalone;
286N/A }
286N/A
286N/A private String xmlVersion;
286N/A public String getXmlVersion() {
286N/A return xmlVersion;
286N/A }
286N/A
286N/A public void setXmlVersion(String xmlVersion) throws DOMException {
286N/A this.xmlVersion = xmlVersion;
286N/A }
286N/A
286N/A
286N/A}