Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
gnu.xml.dom.DomNode
gnu.xml.dom.DomDocument
Constructor Summary | |
| |
|
Method Summary | |
Node | |
Node |
|
Attr |
|
Attr |
|
CDATASection |
|
CDATASection |
|
Comment |
|
DocumentFragment |
|
Element |
|
Element |
|
EntityReference |
|
XPathExpression |
|
XPathNSResolver |
|
NodeIterator |
|
ProcessingInstruction |
|
Text |
|
Text |
|
TreeWalker |
|
Object |
|
String | |
DocumentType |
|
Element |
|
String | |
DOMConfiguration | |
Element |
|
DOMImplementation |
|
String |
|
String |
|
boolean | |
String |
|
boolean | |
String | |
Node |
|
Node |
|
boolean |
|
boolean |
|
String |
|
String |
|
void | |
Node |
|
Node |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
static void |
|
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
public DomDocument()
Constructs a Document node, associating it with an instance of the DomImpl class. Note that this constructor disables character checking. It is normally used when connecting a DOM to an XML parser, and duplicating such checks is undesirable. When used for purposes other than connecting to a parser, you should re-enable that checking.
- See Also:
setCheckingCharacters(boolean)
protected DomDocument(DOMImplementation impl)
Constructs a Document node, associating it with the specified implementation. This should only be used in conjunction with a specialized implementation; it will normally be called by that implementation.
- See Also:
DomImpl
,setCheckingCharacters(boolean)
public Node appendChild(Node newChild)
DOM L1 Appends the specified node to this node's list of children, enforcing the constraints that there be only one root element and one document type child.
- Specified by:
- appendChild in interface Node
- Overrides:
- appendChild in interface DomNode
public Attr createAttribute(String name)
DOM L1 Returns a newly created attribute with the specified name.
- Specified by:
- createAttribute in interface Document
public Attr createAttributeNS(String namespaceURI, String name)
DOM L2 Returns a newly created attribute with the specified name and namespace information.
- Specified by:
- createAttributeNS in interface Document
public CDATASection createCDATASection(char[] buf, int off, int len)
Returns a newly created CDATA section node with the specified value.
public CDATASection createCDATASection(String value)
DOM L1 Returns a newly created CDATA section node with the specified value.
- Specified by:
- createCDATASection in interface Document
public Comment createComment(String value)
DOM L1 Returns a newly created comment node with the specified value.
- Specified by:
- createComment in interface Document
public DocumentFragment createDocumentFragment()
DOM L1 Returns a newly created document fragment.
- Specified by:
- createDocumentFragment in interface Document
public Element createElement(String name)
DOM L1 Returns a newly created element with the specified name. The node name of the created element will be equal toname
. The namespace, prefix and local name will all benull
.
- Specified by:
- createElement in interface Document
public Element createElementNS(String namespaceURI, String name)
DOM L2 Returns a newly created element with the specified name and namespace information.
- Specified by:
- createElementNS in interface Document
public EntityReference createEntityReference(String name)
DOM L1 Returns a newly created reference to the specified entity. The caller should populate this with the appropriate children and then mark it as readonly.
- Specified by:
- createEntityReference in interface Document
- See Also:
DomNode.makeReadonly()
public XPathExpression createExpression(String expression, XPathNSResolver resolver) throws XPathException, DOMException
- Specified by:
- createExpression in interface XPathEvaluator
public XPathNSResolver createNSResolver(Node nodeResolver)
- Specified by:
- createNSResolver in interface XPathEvaluator
public NodeIterator createNodeIterator(Node root, int whatToShow, NodeFilter filter, boolean expandEntities)
DOM L2 (Traversal) Returns a newly created node iterator. Don't forget to detach this iterator when you're done using it!
- Specified by:
- createNodeIterator in interface DocumentTraversal
- See Also:
DomIterator
public ProcessingInstruction createProcessingInstruction(String target, String data)
DOM L1 Returns a newly created processing instruction.
- Specified by:
- createProcessingInstruction in interface Document
public Text createTextNode(char[] buf, int off, int len)
Returns a newly created text node with the specified value.
public Text createTextNode(String value)
DOM L1 Returns a newly created text node with the specified value.
- Specified by:
- createTextNode in interface Document
public TreeWalker createTreeWalker(Node root, int whatToShow, NodeFilter filter, boolean expandEntities)
- Specified by:
- createTreeWalker in interface DocumentTraversal
public Object evaluate(String expression, Node contextNode, XPathNSResolver resolver, short type, Object result) throws XPathException, DOMException
- Specified by:
- evaluate in interface XPathEvaluator
public String getBaseURI()
- Specified by:
- getBaseURI in interface Node
- Overrides:
- getBaseURI in interface DomNode
public final DocumentType getDoctype()
DOM L1 Returns the document's DocumentType, or null.
- Specified by:
- getDoctype in interface Document
public final Element getDocumentElement()
DOM L1 Returns the document's root element, or null.
- Specified by:
- getDocumentElement in interface Document
public Element getElementById(String id)
DOM L1 (relocated in DOM L2) Returns the element with the specified "ID" attribute, or null. Returns null unlessConsumer
was used to populate internal DTD declaration information, using package-private APIs. If that internal DTD information is available, the document may be searched for the element with that ID.
- Specified by:
- getElementById in interface Document
public final DOMImplementation getImplementation()
DOM L1 Returns the document's DOMImplementation.
- Specified by:
- getImplementation in interface Document
public String getInputEncoding()
DOM L3
- Specified by:
- getInputEncoding in interface Document
public final String getNodeName()
DOM L1 Returns the constant "#document".
- Specified by:
- getNodeName in interface Node
- Overrides:
- getNodeName in interface DomNode
public boolean getStrictErrorChecking()
- Specified by:
- getStrictErrorChecking in interface Document
public String getXmlEncoding()
DOM L3
- Specified by:
- getXmlEncoding in interface Document
public boolean getXmlStandalone()
- Specified by:
- getXmlStandalone in interface Document
public Node importNode(Node src, boolean deep)
DOM L2 Makes a copy of the specified node, with all nodes "owned" by this document and with children optionally copied. This type of standard utility has become, well, a standard utility. Note that EntityReference nodes created through this method (either directly, or recursively) never have children, and that there is no portable way to associate them with such children. Note also that there is no requirement that the specified node be associated with a different document. This differs from the cloneNode operation in that the node itself is not given an opportunity to participate, so that any information managed by node subclasses will be lost.
- Specified by:
- importNode in interface Document
public Node insertBefore(Node newChild, Node refChild)
DOM L1 Inserts the specified node in this node's list of children, enforcing the constraints that there be only one root element and one document type child.
- Specified by:
- insertBefore in interface Node
- Overrides:
- insertBefore in interface DomNode
public boolean isDefaultNamespace(String namespaceURI)
- Specified by:
- isDefaultNamespace in interface Node
- Overrides:
- isDefaultNamespace in interface DomNode
public boolean isEqualNode(Node arg)
- Specified by:
- isEqualNode in interface Node
- Overrides:
- isEqualNode in interface DomNode
public String lookupNamespaceURI(String prefix)
- Specified by:
- lookupNamespaceURI in interface Node
- Overrides:
- lookupNamespaceURI in interface DomNode
public String lookupPrefix(String namespaceURI)
- Specified by:
- lookupPrefix in interface Node
- Overrides:
- lookupPrefix in interface DomNode
public void normalizeDocument()
- Specified by:
- normalizeDocument in interface Document
public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws DOMException
- Specified by:
- renameNode in interface Document
public Node replaceChild(Node newChild, Node refChild)
DOM L1 Replaces the specified node in this node's list of children, enforcing the constraints that there be only one root element and one document type child.
- Specified by:
- replaceChild in interface Node
- Overrides:
- replaceChild in interface DomNode
public void setBuilding(boolean flag)
Sets thebuilding
flag. Mutation events in the document are not reported.
public void setCheckWellformedness(boolean flag)
Sets whether to check for document well-formedness. If true, an exception will be raised if a second doctype or root element node is added to the document.
public void setCheckingCharacters(boolean flag)
Sets whether to check for document characters.
public void setDefaultAttributes(boolean flag)
Sets whether to default attributes for new elements.
public void setDocumentURI(String documentURI)
- Specified by:
- setDocumentURI in interface Document
public void setStrictErrorChecking(boolean strictErrorChecking)
- Specified by:
- setStrictErrorChecking in interface Document
public void setXmlStandalone(boolean xmlStandalone)
- Specified by:
- setXmlStandalone in interface Document
public void setXmlVersion(String xmlVersion)
- Specified by:
- setXmlVersion in interface Document
public static void verifyXmlName(String name)
Deprecated. This method is deprecated and may be removed in future versions of GNU JAXP
Throws a DOM exception if the specified name is not a legal XML 1.0 Name.