Package org.w3c.tidy

# Class DOMDocumentImpl

java.lang.Object
org.w3c.tidy.DOMNodeImpl
org.w3c.tidy.DOMDocumentImpl

All Implemented Interfaces:
  `Document`, `Node`

public class DOMDocumentImpl extends DOMNodeImpl implements Document
DOMDocumentImpl.

Version:
  $Revision: 1125 $ ($Author: aditsu $)
Author:
  Dave Raggett dsr@w3.org , Andy Quick ac.quick@sympatico.ca (translation to Java), Fabrizio Giustina

## Field Summary

### Fields inherited from class org.w3c.tidy.DOMNodeImpl

`adaptee`

### Fields inherited from interface org.w3c.dom.Node

`ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE`

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`DOMDocumentImpl(Node adaptee)`
Instantiates a new Dom document with a default tag table.

## Method Summary

Modifier and Type
Method
Description
`Node`
`adoptNode(Node source)`
`Attr`
`createAttribute(String name)`
`Attr`
`createAttributeNS(String namespaceURI, String qualifiedName)`
`CDATASection`
`createCDATASection(String data)`
`Comment`
`createComment(String data)`
`DocumentFragment`
`createDocumentFragment()`
`Element`
`createElement(String tagName)`
`Element`
`createElementNS(String namespaceURI, String qualifiedName)`
`EntityReference`
`createEntityReference(String name)`
`ProcessingInstruction`
`createProcessingInstruction(String target, String data)`
`Text`
`createTextNode(String data)`
`DocumentType`
`getDoctype()`
`Element`
`getDocumentElement()`
`String`
`getDocumentURI()`
`DOMConfiguration`
`getDomConfig()`
`Element`
`getElementById(String elementId)`
`NodeList`
`getElementsByTagName(String tagname)`
`NodeList`
`getElementsByTagNameNS(String namespaceURI, String localName)`
`DOMImplementation`
`getImplementation()`
`String`
`getInputEncoding()`
`String`
`getNodeName()`
`short`
`getNodeType()`
`boolean`
`getStrictErrorChecking()`
`String`
`getXmlEncoding()`
`boolean`
`getXmlStandalone()`
`String`
`getXmlVersion()`
`Node`
`importNode(Node importedNode, boolean deep)`
`void`
`normalizeDocument()`
`Node`
`renameNode(Node n, String namespaceURI, String qualifiedName)`
`void`
`setDocumentURI(String documentURI)`
`void`
`setStrictErrorChecking(boolean strictErrorChecking)`
`void`
`setXmlStandalone(boolean xmlStandalone)`
`void`
`setXmlVersion(String xmlVersion)`

### Methods inherited from class org.w3c.tidy.DOMNodeImpl

`appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData, supports`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.w3c.dom.Node

`appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData`

## Constructor Details

### DOMDocumentImpl

protected DOMDocumentImpl(Node adaptee)
Instantiates a new Dom document with a default tag table.

Parameters:
  `adaptee` - tidy Node

## Method Details

### getNodeName

public String getNodeName()

Specified by:
  `getNodeName` in interface `Node`
Overrides:
  `getNodeName` in class `DOMNodeImpl`
See Also:
  - `Node.getNodeName()`

### getNodeType

public short getNodeType()

Specified by:
  `getNodeType` in interface `Node`
Overrides:
  `getNodeType` in class `DOMNodeImpl`
See Also:
  - `Node.getNodeType()`

### getDoctype

public DocumentType getDoctype()

Specified by:
  `getDoctype` in interface `Document`
See Also:
  - `Document.getDoctype()`

### getImplementation

public DOMImplementation getImplementation()

Specified by:
  `getImplementation` in interface `Document`
See Also:
  - `Document.getImplementation()`
To Do:
  DOM level 2 getImplementation() Not implemented. Throws NOT_SUPPORTED_ERR.

### getDocumentElement

public Element getDocumentElement()

Specified by:
  `getDocumentElement` in interface `Document`
See Also:
  - `Document.getDocumentElement()`

### createElement

public Element createElement(String tagName) throws DOMException

Specified by:
  `createElement` in interface `Document`
Throws:
  `DOMException`
See Also:
  - `Document.createElement(java.lang.String)`

### createDocumentFragment

public DocumentFragment createDocumentFragment()

Specified by:
  `createDocumentFragment` in interface `Document`
See Also:
  - `Document.createDocumentFragment()`
To Do:
  DOM level 2 createDocumentFragment() Not implemented. Throws NOT_SUPPORTED_ERR.

### createTextNode

public Text createTextNode(String data)

Specified by:
  `createTextNode` in interface `Document`
See Also:
  - `Document.createTextNode(java.lang.String)`

### createComment

public Comment createComment(String data)

Specified by:
  `createComment` in interface `Document`
See Also:
  - `Document.createComment(java.lang.String)`

### createCDATASection

public CDATASection createCDATASection(String data) throws DOMException

Specified by:
  `createCDATASection` in interface `Document`
Throws:
  `DOMException`
See Also:
  - `Document.createCDATASection(java.lang.String)`
To Do:
  DOM level 2 createCDATASection() Not supported. Throws NOT_SUPPORTED_ERR.

### createProcessingInstruction

public ProcessingInstruction createProcessingInstruction(String target, String data) throws DOMException

Specified by:
  `createProcessingInstruction` in interface `Document`
Throws:
  `DOMException`
See Also:
  - `Document.createProcessingInstruction(java.lang.String, java.lang.String)`
To Do:
  DOM level 2 createProcessingInstruction() Not supported. Throws NOT_SUPPORTED_ERR.

### createAttribute

public Attr createAttribute(String name) throws DOMException

Specified by:
  `createAttribute` in interface `Document`
Throws:
  `DOMException`
See Also:
  - `Document.createAttribute(java.lang.String)`

### createEntityReference

public EntityReference createEntityReference(String name) throws DOMException

Specified by:
  `createEntityReference` in interface `Document`
Throws:
  `DOMException`
See Also:
  - `Document.createEntityReference(java.lang.String)`
To Do:
  DOM level 2 createEntityReference() Not supported. Throws NOT_SUPPORTED_ERR.

### getElementsByTagName

public NodeList getElementsByTagName(String tagname)

Specified by:
  `getElementsByTagName` in interface `Document`
See Also:
  - `Document.getElementsByTagName(java.lang.String)`

### importNode

public Node importNode(Node importedNode, boolean deep) throws DOMException

Specified by:
  `importNode` in interface `Document`
Throws:
  `DOMException`
See Also:
  - `Document.importNode(org.w3c.dom.Node, boolean)`
To Do:
  DOM level 2 importNode() Not supported. Throws NOT_SUPPORTED_ERR.

### createAttributeNS

public Attr createAttributeNS(String namespaceURI, String qualifiedName) throws DOMException

Specified by:
  `createAttributeNS` in interface `Document`
Throws:
  `DOMException`
See Also:
  - `Document.createAttributeNS(java.lang.String, java.lang.String)`
To Do:
  DOM level 2 createAttributeNS() Not supported. Throws NOT_SUPPORTED_ERR.

### createElementNS

public Element createElementNS(String namespaceURI, String qualifiedName) throws DOMException

Specified by:
  `createElementNS` in interface `Document`
Throws:
  `DOMException`
See Also:
  - `Document.createElementNS(java.lang.String, java.lang.String)`
To Do:
  DOM level 2 createElementNS() Not supported. Throws NOT_SUPPORTED_ERR.

### getElementsByTagNameNS

public NodeList getElementsByTagNameNS(String namespaceURI, String localName)

Specified by:
  `getElementsByTagNameNS` in interface `Document`
See Also:
  - `Document.getElementsByTagNameNS(java.lang.String, java.lang.String)`
To Do:
  DOM level 2 getElementsByTagNameNS() Not supported. Throws NOT_SUPPORTED_ERR.

### getElementById

public Element getElementById(String elementId)

Specified by:
  `getElementById` in interface `Document`
See Also:
  - `Document.getElementById(java.lang.String)`
To Do:
  DOM level 2 getElementById() Not implemented. Returns null.

### adoptNode

public Node adoptNode(Node source) throws DOMException

Specified by:
  `adoptNode` in interface `Document`
Throws:
  `DOMException`
See Also:
  - `Document.adoptNode(org.w3c.dom.Node)`
To Do:
  DOM level 3 adoptNode() Not implemented.

### getDocumentURI

public String getDocumentURI()

Specified by:
  `getDocumentURI` in interface `Document`
See Also:
  - `Document.getDocumentURI()`
To Do:
  DOM level 3 getDocumentURI() Not implemented. Returns null.

### getDomConfig

public DOMConfiguration getDomConfig()

Specified by:
  `getDomConfig` in interface `Document`
See Also:
  - `Document.getDomConfig()`
To Do:
  DOM level 3 getDomConfig() Not implemented. Returns null.

### getInputEncoding

public String getInputEncoding()

Specified by:
  `getInputEncoding` in interface `Document`
See Also:
  - `Document.getInputEncoding()`
To Do:
  DOM level 3 getInputEncoding() Not implemented. Returns null.

### getStrictErrorChecking

public boolean getStrictErrorChecking()

Specified by:
  `getStrictErrorChecking` in interface `Document`
See Also:
  - `Document.getStrictErrorChecking()`
To Do:
  DOM level 3 getStrictErrorChecking() Not implemented. Returns true.

### getXmlEncoding

public String getXmlEncoding()

Specified by:
  `getXmlEncoding` in interface `Document`
See Also:
  - `Document.getXmlEncoding()`
To Do:
  DOM level 3 getXmlEncoding() Not implemented. Returns null.

### getXmlStandalone

public boolean getXmlStandalone()

Specified by:
  `getXmlStandalone` in interface `Document`
See Also:
  - `Document.getXmlStandalone()`
To Do:
  DOM level 3 getXmlStandalone() Not implemented. Returns false.

### getXmlVersion

public String getXmlVersion()

Specified by:
  `getXmlVersion` in interface `Document`
See Also:
  - `Document.getXmlVersion()`
To Do:
  DOM level 3 getXmlVersion() Not implemented. Always returns "1.0".

### normalizeDocument

public void normalizeDocument()

Specified by:
  `normalizeDocument` in interface `Document`
See Also:
  - `Document.normalizeDocument()`
To Do:
  DOM level 3 normalizeDocument() Not implemented. Do nothing.

### renameNode

public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws DOMException

Specified by:
  `renameNode` in interface `Document`
Throws:
  `DOMException`
See Also:
  - `Document.renameNode(org.w3c.dom.Node, java.lang.String, java.lang.String)`
To Do:
  DOM level 3 renameNode() Not implemented. Throws NOT_SUPPORTED_ERR.

### setDocumentURI

public void setDocumentURI(String documentURI)

Specified by:
  `setDocumentURI` in interface `Document`
See Also:
  - `Document.setDocumentURI(java.lang.String)`
To Do:
  DOM level 3 setDocumentURI() Not implemented. Do nothing.

### setStrictErrorChecking

public void setStrictErrorChecking(boolean strictErrorChecking)

Specified by:
  `setStrictErrorChecking` in interface `Document`
See Also:
  - `Document.setStrictErrorChecking(boolean)`
To Do:
  DOM level 3 setStrictErrorChecking() Not implemented. Do nothing.

### setXmlStandalone

public void setXmlStandalone(boolean xmlStandalone) throws DOMException

Specified by:
  `setXmlStandalone` in interface `Document`
Throws:
  `DOMException`
See Also:
  - `Document.setXmlStandalone(boolean)`
To Do:
  DOM level 3 setXmlStandalone() Not implemented. Do nothing.

### setXmlVersion

public void setXmlVersion(String xmlVersion) throws DOMException

Specified by:
  `setXmlVersion` in interface `Document`
Throws:
  `DOMException`
See Also:
  - `Document.setXmlVersion(java.lang.String)`
To Do:
  DOM level 3 setXmlVersion() Not implemented. Do nothing.