org.apache.crimson.tree
Interface DocumentEx

All Superinterfaces:
org.w3c.dom.Document, ElementFactory, org.w3c.dom.Node, XmlWritable
All Known Implementing Classes:
XmlDocument

public interface DocumentEx
extends org.w3c.dom.Document, XmlWritable, ElementFactory

This interface extends the DOM Document model in several useful ways. It supports:

Author:
David Brownell

Field Summary
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Method Summary
 void changeNodeOwner(org.w3c.dom.Node node)
          Changes the "owner document" of the given node, and all child and associated attribute nodes, to be this document.
 Locale chooseLocale(String[] languages)
          Chooses a client locale to use for diagnostics, using the first language specified in the list that is supported by this DOM implementation.
 ElementEx getElementExById(String id)
          Deprecated. As of DOM level 2, replaced by the method Document.getElementById
 ElementFactory getElementFactory()
          Returns the element factory to be used by this document.
 Locale getLocale()
          Returns the locale to be used for diagnostic messages.
 String getSystemId()
          Returns the system ID (a URI) associated with the document, or null if this is unknown.
 void setElementFactory(ElementFactory factory)
          Assigns the element factory to be used by this document.
 void setLocale(Locale locale)
          Assigns the locale to be used for diagnostic messages.
 
Methods inherited from interface org.w3c.dom.Document
createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, getDoctype, getDocumentElement, getElementById, getElementsByTagName, getElementsByTagNameNS, getImplementation, importNode
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 
Methods inherited from interface org.apache.crimson.tree.XmlWritable
writeChildrenXml, writeXml
 
Methods inherited from interface org.apache.crimson.tree.ElementFactory
createElementEx, createElementEx
 

Method Detail

getSystemId

public String getSystemId()
Returns the system ID (a URI) associated with the document, or null if this is unknown.


setElementFactory

public void setElementFactory(ElementFactory factory)
Assigns the element factory to be used by this document.


getElementFactory

public ElementFactory getElementFactory()
Returns the element factory to be used by this document.


getElementExById

public ElementEx getElementExById(String id)
Deprecated. As of DOM level 2, replaced by the method Document.getElementById

Returns the element whose ID is given by the parameter; or null if no such element is known. Element IDs are declared by attributes of type "ID", and are commonly used for internal linking by using attributes of type IDREF or IDREFS to turn XML's hierarchical data structure into a directed graph.

Note that DOM itself provides no way to identify which element attributes are declared with the "ID" attribute type. This feature relies on interfaces which may not be publicly exposed, such as XML processors telling a DOM builder about those attributes.

Parameters:
id - The value of the ID attribute which will be matched by any element which is returned.

getLocale

public Locale getLocale()
Returns the locale to be used for diagnostic messages.


setLocale

public void setLocale(Locale locale)
Assigns the locale to be used for diagnostic messages. Multi-language applications, such as web servers dealing with clients from different locales, need the ability to interact with clients in languages other than the server's default. When a Document is created, its locale is the default locale for the virtual machine.

See Also:
chooseLocale(java.lang.String[])

chooseLocale

public Locale chooseLocale(String[] languages)
Chooses a client locale to use for diagnostics, using the first language specified in the list that is supported by this DOM implementation. That locale is then automatically assigned using setLocale(). Such a list could be provided by a variety of user preference mechanisms, including the HTTP Accept-Language header field.

Parameters:
languages - Array of language specifiers, ordered with the most preferable one at the front. For example, "en-ca" then "fr-ca", followed by "zh_CN". Both RFC 1766 and Java styles are supported.
Returns:
The chosen locale, or null.
See Also:
MessageCatalog

changeNodeOwner

public void changeNodeOwner(org.w3c.dom.Node node)
Changes the "owner document" of the given node, and all child and associated attribute nodes, to be this document. If the node has a parent, it is first removed from that parent.

Parameters:
node - the node whose "owner" will be changed.
Throws:
DOMException - WRONG_DOCUMENT_ERROR when attempting to change the owner for some other DOM implementation

HIERARCHY_REQUEST_ERROR when the node is a document, document type, entity, or notation; or when it is an attribute associated with an element whose owner is not being (recursively) changed.