Class XMLDocument
- All Implemented Interfaces:
EventTarget,Document,ModelNode,Node,NonElementParentNode,ParentNode,DocumentRange,DocumentTraversal
-
Field Summary
Fields inherited from interface org.loboevolution.html.node.Document
HTML_NAMESPACE_URI, NAMESPACE_SVG, XML_NAMESPACE_URI, XMLNS_NAMESPACE_URIFields inherited from interface org.loboevolution.html.node.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, NONE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEventListener(String type, Function listener) addEventListener.voidaddEventListener(String type, Function listener, boolean useCapture) addEventListener.Moves node from another document and returns it.appendChild(Node newChild) appendChild.voidappendChildrenToCollectionImpl(NodeFilter filter, Collection<Node> collection) caretRangeFromPoint(double x, double y) caretRangeFromPoint.voidclear()clear.cloneNode.cloneNode(boolean deep) Returns a copy of node.voidclose()Closes an output stream and forces the sent data to display.shortcompareDocumentPosition(Node other) compareDocumentPosition.booleanReturns true if other is an inclusive descendant of node, and false otherwise.createAttribute(String name) Creates an attribute object with a specified name.createAttributeNS(String namespaceURI, String qualifiedName) createAttributeNS.createCDATASection(String data) Returns a CDATASection node whose data is data.createComment(String data) Creates a comment object with the specified data.Creates a new document.createElement(String tagName) Creates an instance of the element for the specified tag.createElementNS(String namespaceURI, String qualifiedName) createElementNS.createElementNS(String namespace, String qualifiedName, String options) Returns an element with namespace.createEntityReference(String ent1) createEvent(String eventInterface) createEvent.createExpression.createNodeIterator(Node root) Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.createNodeIterator(Node root, int whatToShow) Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.createNodeIterator(Node root, int whatToShow, NodeFilter filter) Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.createNodeIterator(Node root, NodeFilter filter) Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.createNSResolver(Node nodeResolver) createNSResolver.createProcessingInstruction(String target, String data) Returns a ProcessingInstruction node whose target is target and data is data.Returns an empty range object that has both of its boundary points positioned at the beginning of the document.createTextNode(String data) Creates a text string from the specified value.createTreeWalker(Node root) createTreeWalker.createTreeWalker(Node root, int whatToShow) createTreeWalker.createTreeWalker(Node root, int whatToShow, NodeFilter filter) createTreeWalker.createTreeWalker(Node root, NodeFilter filter) createTreeWalker.booleandispatchEvent(Event evt) dispatchEvent.booleandispatchEvent(Node element, Event evt) dispatchEvent.elementFromPoint(double x, double y) Returns the element for the specified x coordinate and the specified y coordinate.evaluate(String expression, Node contextNode, XPathNSResolver resolver, short type, Object result) evaluate.booleanexecCommand(String commandId) execCommand.booleanexecCommand(String commandId, boolean showUI) execCommand.booleanexecCommand(String commandId, boolean showUI, String value) Executes a command on the current document, current selection, or the given range.voidextractDescendentsArrayImpl(NodeFilter filter, List<Node> al, boolean nestIntoMatchingNodes) Extracts all descendents that match the filter, except those descendents of nodes that match the filter.Tries to get a UINode associated with the current node.voidGets the object that has the focus when the parent document has focus.getall()Returns a reference to the collection of elements contained by the object.Retrieves a collection of all a objects that have a name and/or id property.Retrieves a collection of all applet objects in the document.getAttributes.Returns node's node document's document base URL.Deprecated.getBody()Specifies the beginning and end of the document body.Returns document's encoding.Gets or sets the character set used to encode the object.intgetChildElementCount.Returns the children.Returns the child elements.getCommands.Gets a value that indicates whether standards-compliant mode is switched on for the object.Returns document's content type.Returns the HTTP cookies that apply to the Document.Returns the script element, or the SVG script element, that is currently executing, as long as the element represents a classic script.getDefaultView.Sets or gets a value that indicates whether the document can be edited.getDir()Sets or retrieves a value that indicates the reading order of the object.Gets an object representing the document type declaration associated with the current document.Gets a reference to the root node of the document.getDocumentItem(String name) getDocumentItem.Returns document's URL.Sets or gets the security domain of the document.getDomConfig.getElementById(String id) Returns the first element within node's descendants whose ID is elementId.getElementsByClassName(String classNames) Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames.getElementsByName(String elementName) Gets a collection of objects based on the value of the NAME or ID attribute.getElementsByTagName(String tagname) Retrieves a collection of objects based on the specified element name.getElementsByTagNameNS(String namespaceURI, String localName) If namespace and localName are "*" returns a HTMLCollection of all descendant elements.Retrieves a collection of all embed objects in the document.getFeature(String name, String version) Sets or gets the foreground (text) color of the document.Returns the first child.Returns the first child that is an element, and null otherwise.getForms()Retrieves a collection, in source order, of all form objects in the document.getFullURL(String spec) getFullURL.getHead()Returns the head element.Retrieves a collection, in source order, of img objects in the document.Gets the implementation object of the current document.Returns the character encoding used to create the webpage that is loaded into the document object.Returns the last child.Returns the last child that is an element, and null otherwise.Gets the date that the page was last modified, if the page supplies one.getLinks()Retrieves a collection of all a objects that specify the href property and all area objects in the document.getLocalName.Contains information about the current URL.getNamespaceURI.Returns the next sibling.Returns a string appropriate for the type of node.intReturns the type of node.getNodeValue.Returns document's origin.Returns the node document.Returns the parent element.getParentModelNode.Returns the parent.Return an HTMLCollection of the embed elements in the Document.Returns prefix.Returns the previous sibling.getPreviousTo(Node node) Retrieves a value that indicates the current state of the object.Gets the URL of the location that referred the user to the current page.getRenderState.Returns node's root.Retrieves a collection of all script objects in the document.getScrollingElement.Returns an object representing the current selection of the document that is loaded into the object displaying a webpage.booleangetStrictErrorChecking.getTextContent.getTitle()Contains the title of the document.getURL()Sets or gets the URL for the current document.getUserData(String key) getUserData.getVisibilityState.getXML()getXML.getXmlEncoding.booleangetXmlStandalone.getXmlVersion.booleanReturns true if element has attributes, and false otherwise.booleanReturns whether node has children.booleanhasFocus()Gets a value indicating whether the object currently has focus.importNode(Node importedNode, boolean deep) Returns a copy of node.insertBefore(Node newChild, Node refChild) insertBefore.booleanisDefaultNamespace(String namespaceURI) isDefaultNamespace.booleanisEqualNode(Node arg) Returns whether node and otherNode have the same properties.booleanisEqualOrDescendentOf(ModelNode otherNode) isEqualOrDescendentOf.booleanisFullscreen.booleanReturns true if document has the ability to display elements fullscreen and fullscreen is supported, or false otherwise.booleanisHidden()isHidden.booleanReturns true if node is connected and false otherwise.booleanisSameNode(Node other) isSameNode.booleanisSupported(String xml, String s) booleanisXml()static XMLDocumentLoad XML fileLoad XML filelookupNamespaceURI(String prefix) lookupNamespaceURI.lookupPrefix(String namespaceURI) lookupPrefix.voidRemoves empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.voidnormalizeDocument.open()open.open.open.open.Opens a new window and loads a document specified by a given URL.prepend.prependChild(Node newChild) prependChild.booleanqueryCommandEnabled(String commandId) Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document.booleanqueryCommandIndeterm(String commandId) Returns a Boolean value that indicates whether the specified command is in the indeterminate state.booleanqueryCommandState(String commandId) Returns a Boolean value that indicates the current state of the command.booleanqueryCommandSupported(String commandId) Returns a Boolean value that indicates whether the current command is supported on the current range.queryCommandValue(String commandId) Returns the current value of the document, range, or current selection for the given command.querySelector(String selectors) Returns the first element that is a descendant of node that matches selectors.querySelectorAll(String selectors) Returns all element descendants of node that match selectors.voidreleaseEvents.removeChild(Node oldChild) removeChild.voidremoveEventListener(String type, Function listener) removeEventListener.voidremoveEventListener(String type, Function listener, boolean useCapture) removeEventListener.renameNode(Node node, String namespaceURI, String qualifiedName) replaceChild(Node newChild, Node oldChild) replaceChild.voidsetBgColor(String bgColor) setBgColor.voidsetBody(HTMLElement body) setBody.voidsetCookie.voidsetDesignMode(String designMode) setDesignMode.voidsetDir.voidsetDocumentItem(String name, Object value) Sets a document item.voidsetDocumentURI(String documentURI) setDocumentURI.voidsetDomain.voidsetFgColor(String fgColor) setFgColor.voidsetLocation(Location location) setLocation.voidsetNamespaceURI(String namespaceURI) voidsetNodeValue(String nodeValue) setNodeValue.voidsetOwnerDocument(Document document) setOwnerDocument.voidsetOwnerDocument(Document value, boolean deep) setOwnerDocument.voidsetParentImpl(Node parent) setParentImpl.voidsetPrefix.voidsetStrictErrorChecking(boolean strictErrorChecking) setStrictErrorChecking.voidsetTextContent(String textContent) setTextContent.voidsetTitle.setUserData(String key, Object data, UserDataHandler handler) setUserData.voidsetXml(boolean xml) voidsetXmlStandalone(boolean xmlStandalone) setXmlStandalone.voidsetXmlVersion(String xmlVersion) setXmlVersion.toString()voidvisit(NodeVisitor visitor) visit.voidwarn.voidWrites one or more HTML expressions to a document in the specified window.voidWrites one or more HTML expressions, followed by a carriage return, to a document in the specified window.
-
Constructor Details
-
XMLDocument
public XMLDocument()
-
-
Method Details
-
load
Load XML file- Parameters:
fileName- name of file in file system- Returns:
- XMLDocument
-
loadXML
Load XML file- Parameters:
fileName- name of file in file system- Returns:
- XML String
-
getXML
getXML.
- Returns:
- XML String
-
getElementsByTagName
Retrieves a collection of objects based on the specified element name.- Specified by:
getElementsByTagNamein interfaceDocument- Parameters:
tagname- Specifies the name of an element.- Returns:
- a
HTMLCollectionobject.
-
getElementById
Returns the first element within node's descendants whose ID is elementId. Returns a reference to the first object with the specified value of the ID or NAME attribute.- Specified by:
getElementByIdin interfaceDocument- Specified by:
getElementByIdin interfaceNonElementParentNode- Parameters:
id- aStringobject.- Returns:
- a
Elementobject.
-
appendChild
appendChild.
- Specified by:
appendChildin interfaceNode- Parameters:
newChild- aNodeobject.- Returns:
- a
Nodeobject.
-
prependChild
prependChild.
- Specified by:
prependChildin interfaceNode- Parameters:
newChild- aNodeobject.- Returns:
- a
Nodeobject.
-
prepend
prepend.
-
cloneNode
Returns a copy of node. If deep is true, the copy also includes the node's descendants. -
compareDocumentPosition
compareDocumentPosition.
- Specified by:
compareDocumentPositionin interfaceNode- Parameters:
other- aNodeobject.- Returns:
- a short.
-
isSupported
- Specified by:
isSupportedin interfaceNode
-
hasAttributes
public boolean hasAttributes()Description copied from interface:NodeReturns true if element has attributes, and false otherwise.- Specified by:
hasAttributesin interfaceNode- Returns:
- a boolean.
-
getFeature
- Specified by:
getFeaturein interfaceNode
-
getDocumentNode
- Specified by:
getDocumentNodein interfaceNode
-
getBaseURI
Returns node's node document's document base URL.- Specified by:
getBaseURIin interfaceNode- Returns:
- a
Stringobject.
-
getChildNodes
Returns the children.- Specified by:
getChildNodesin interfaceNode- Returns:
- a
NodeListobject.
-
getFirstChild
Returns the first child.- Specified by:
getFirstChildin interfaceNode- Returns:
- a
Nodeobject.
-
getLastChild
Returns the last child.- Specified by:
getLastChildin interfaceNode- Returns:
- a
Nodeobject.
-
getLocalName
getLocalName.
- Specified by:
getLocalNamein interfaceNode- Returns:
- a
Stringobject.
-
getNamespaceURI
getNamespaceURI.
- Specified by:
getNamespaceURIin interfaceNode- Returns:
- a
Stringobject.
-
getNextSibling
Returns the next sibling.- Specified by:
getNextSiblingin interfaceNode- Returns:
- a
Nodeobject.
-
getNodeName
Returns a string appropriate for the type of node.- Specified by:
getNodeNamein interfaceNode- Returns:
- a
Stringobject.
-
getNodeType
public int getNodeType()Returns the type of node.- Specified by:
getNodeTypein interfaceNode- Returns:
- a
Integerobject.
-
getNodeValue
getNodeValue.
- Specified by:
getNodeValuein interfaceNode- Returns:
- a
Stringobject.
-
getOwnerDocument
Returns the node document. Returns null for documents.- Specified by:
getOwnerDocumentin interfaceNode- Returns:
- a
Documentobject.
-
getParentNode
Returns the parent.- Specified by:
getParentNodein interfaceNode- Returns:
- a
Nodeobject.
-
getPrefix
Returns prefix. -
getPreviousSibling
Returns the previous sibling.- Specified by:
getPreviousSiblingin interfaceNode- Returns:
- a
Nodeobject.
-
getTextContent
getTextContent.
- Specified by:
getTextContentin interfaceNode- Returns:
- a
Stringobject.
-
getUserData
getUserData.
- Specified by:
getUserDatain interfaceNode- Parameters:
key- aStringobject.- Returns:
- a
Objectobject.
-
getPreviousTo
- Specified by:
getPreviousToin interfaceNode
-
getNextTo
-
forgetRenderState
public void forgetRenderState()- Specified by:
forgetRenderStatein interfaceNode
-
appendChildrenToCollectionImpl
- Specified by:
appendChildrenToCollectionImplin interfaceNode
-
extractDescendentsArrayImpl
public void extractDescendentsArrayImpl(NodeFilter filter, List<Node> al, boolean nestIntoMatchingNodes) Description copied from interface:NodeExtracts all descendents that match the filter, except those descendents of nodes that match the filter.- Specified by:
extractDescendentsArrayImplin interfaceNode- Parameters:
filter- aNodeFilterobject.al- aArrayListobject.
-
findUINode
Description copied from interface:NodeTries to get a UINode associated with the current node. Failing that, it tries ancestors recursively. This method will return the closest block-level renderer node, if any.- Specified by:
findUINodein interfaceNode- Returns:
- a
UINodeobject.
-
visit
Description copied from interface:Nodevisit.
- Specified by:
visitin interfaceNode- Parameters:
visitor- aNodeVisitorobject.
-
hasChildNodes
public boolean hasChildNodes()Returns whether node has children.- Specified by:
hasChildNodesin interfaceNode- Returns:
- a boolean.
-
insertBefore
insertBefore.
- Specified by:
insertBeforein interfaceNode- Parameters:
newChild- aNodeobject.refChild- aNodeobject.- Returns:
- a
Nodeobject.
-
isDefaultNamespace
isDefaultNamespace.
- Specified by:
isDefaultNamespacein interfaceNode- Parameters:
namespaceURI- aStringobject.- Returns:
- a boolean.
-
isEqualNode
Returns whether node and otherNode have the same properties.- Specified by:
isEqualNodein interfaceNode- Parameters:
arg- aNodeobject.- Returns:
- a boolean.
-
isSameNode
isSameNode.
- Specified by:
isSameNodein interfaceNode- Parameters:
other- aNodeobject.- Returns:
- a boolean.
-
lookupNamespaceURI
lookupNamespaceURI.
- Specified by:
lookupNamespaceURIin interfaceNode- Parameters:
prefix- aStringobject.- Returns:
- a
Stringobject.
-
lookupPrefix
lookupPrefix.
- Specified by:
lookupPrefixin interfaceNode- Parameters:
namespaceURI- aStringobject.- Returns:
- a
Stringobject.
-
normalize
public void normalize()Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes. -
removeChild
removeChild.
- Specified by:
removeChildin interfaceNode- Parameters:
oldChild- aNodeobject.- Returns:
- a
Nodeobject.
-
replaceChild
replaceChild.
- Specified by:
replaceChildin interfaceNode- Parameters:
newChild- aNodeobject.oldChild- aNodeobject.- Returns:
- a
Nodeobject.
-
getAttributes
Description copied from interface:NodegetAttributes.
- Specified by:
getAttributesin interfaceNode- Returns:
- a
NamedNodeMapobject.
-
setNodeValue
setNodeValue.
- Specified by:
setNodeValuein interfaceNode- Parameters:
nodeValue- aStringobject.
-
setPrefix
setPrefix.
-
setTextContent
setTextContent.
- Specified by:
setTextContentin interfaceNode- Parameters:
textContent- aStringobject.
-
setUserData
setUserData.
- Specified by:
setUserDatain interfaceNode- Parameters:
key- aStringobject.data- aObjectobject.handler- aUserDataHandlerobject.- Returns:
- a
Objectobject.
-
setParentImpl
Description copied from interface:NodesetParentImpl.
- Specified by:
setParentImplin interfaceNode- Parameters:
parent- aNodeobject.
-
setNamespaceURI
- Specified by:
setNamespaceURIin interfaceNode
-
adoptNode
Moves node from another document and returns it.If node is a document, throws a "NotSupportedError" DOMException or, if node is a shadow root, throws a "HierarchyRequestError" DOMException.
-
createEntityReference
- Specified by:
createEntityReferencein interfaceDocument
-
renameNode
- Specified by:
renameNodein interfaceDocument
-
createAttribute
Creates an attribute object with a specified name.- Specified by:
createAttributein interfaceDocument- Parameters:
name- String that sets the attribute object's name.- Returns:
- a
Attrobject.
-
createAttributeNS
createAttributeNS.
- Specified by:
createAttributeNSin interfaceDocument- Parameters:
namespaceURI- aStringobject.qualifiedName- aStringobject.- Returns:
- a
Attrobject.
-
createCDATASection
Returns a CDATASection node whose data is data.- Specified by:
createCDATASectionin interfaceDocument- Parameters:
data- aStringobject.- Returns:
- a
CDATASectionobject.
-
createComment
Creates a comment object with the specified data.- Specified by:
createCommentin interfaceDocument- Parameters:
data- Sets the comment object's data.- Returns:
- a
Commentobject.
-
createDocumentFragment
Creates a new document.- Specified by:
createDocumentFragmentin interfaceDocument- Returns:
- a
DocumentFragmentobject.
-
createElement
Creates an instance of the element for the specified tag.- Specified by:
createElementin interfaceDocument- Parameters:
tagName- The name of an element.- Returns:
- a
Elementobject.
-
createElementNS
createElementNS.
- Specified by:
createElementNSin interfaceDocument- Parameters:
namespaceURI- aStringobject.qualifiedName- aStringobject.- Returns:
- a
Elementobject.
-
createProcessingInstruction
Returns a ProcessingInstruction node whose target is target and data is data. If target does not match the Name production an "InvalidCharacterError" DOMException will be thrown. If data contains "?>" an "InvalidCharacterError" DOMException will be thrown.- Specified by:
createProcessingInstructionin interfaceDocument- Parameters:
target- aStringobject.data- aStringobject.- Returns:
- a
ProcessingInstructionobject.
-
createTextNode
Creates a text string from the specified value.- Specified by:
createTextNodein interfaceDocument- Parameters:
data- String that specifies the nodeValue property of the text node.- Returns:
- a
Textobject.
-
getDoctype
Gets an object representing the document type declaration associated with the current document.- Specified by:
getDoctypein interfaceDocument- Returns:
- a
DocumentTypeobject.
-
getDocumentElement
Gets a reference to the root node of the document.- Specified by:
getDocumentElementin interfaceDocument- Returns:
- a
Elementobject.
-
getDocumentURI
Returns document's URL.- Specified by:
getDocumentURIin interfaceDocument- Returns:
- a
Stringobject.
-
getDomConfig
getDomConfig.
- Specified by:
getDomConfigin interfaceDocument- Returns:
- a
DOMConfigurationobject.
-
getElementsByTagNameNS
If namespace and localName are "*" returns a HTMLCollection of all descendant elements.If only namespace is "*" returns a HTMLCollection of all descendant elements whose local name is localName.
If only localName is "*" returns a HTMLCollection of all descendant elements whose namespace is namespace.
Otherwise, returns a HTMLCollection of all descendant elements whose namespace is namespace and local name is localName.
- Specified by:
getElementsByTagNameNSin interfaceDocument- Parameters:
namespaceURI- aStringobject.localName- aStringobject.- Returns:
- a
HTMLCollectionobject.
-
getImplementation
Gets the implementation object of the current document.- Specified by:
getImplementationin interfaceDocument- Returns:
- a
DOMImplementationobject.
-
getInputEncoding
Returns the character encoding used to create the webpage that is loaded into the document object.- Specified by:
getInputEncodingin interfaceDocument- Returns:
- a
Stringobject.
-
getStrictErrorChecking
public boolean getStrictErrorChecking()getStrictErrorChecking.
- Specified by:
getStrictErrorCheckingin interfaceDocument- Returns:
- a boolean.
-
getXmlEncoding
getXmlEncoding.
- Specified by:
getXmlEncodingin interfaceDocument- Returns:
- a
Stringobject.
-
getXmlStandalone
public boolean getXmlStandalone()getXmlStandalone.
- Specified by:
getXmlStandalonein interfaceDocument- Returns:
- a boolean.
-
getXmlVersion
getXmlVersion.
- Specified by:
getXmlVersionin interfaceDocument- Returns:
- a
Stringobject.
-
importNode
Returns a copy of node. If deep is true, the copy also includes the node's descendants.If node is a document or a shadow root, throws a "NotSupportedError" DOMException.
- Specified by:
importNodein interfaceDocument- Parameters:
importedNode- aNodeobject.deep- a boolean.- Returns:
- a
Nodeobject.
-
normalizeDocument
public void normalizeDocument()normalizeDocument.
- Specified by:
normalizeDocumentin interfaceDocument
-
setDocumentURI
setDocumentURI.
- Specified by:
setDocumentURIin interfaceDocument- Parameters:
documentURI- aStringobject.
-
setStrictErrorChecking
public void setStrictErrorChecking(boolean strictErrorChecking) setStrictErrorChecking.
- Specified by:
setStrictErrorCheckingin interfaceDocument- Parameters:
strictErrorChecking- a boolean.
-
setXmlStandalone
public void setXmlStandalone(boolean xmlStandalone) setXmlStandalone.
- Specified by:
setXmlStandalonein interfaceDocument- Parameters:
xmlStandalone- a boolean.
-
setXmlVersion
setXmlVersion.
- Specified by:
setXmlVersionin interfaceDocument- Parameters:
xmlVersion- aStringobject.
-
isIsConnected
public boolean isIsConnected()Returns true if node is connected and false otherwise.- Specified by:
isIsConnectedin interfaceNode- Returns:
- a boolean.
-
getParentElement
Returns the parent element.- Specified by:
getParentElementin interfaceNode- Returns:
- a
HTMLElementobject.
-
getRootNode
Returns node's root.- Specified by:
getRootNodein interfaceNode- Returns:
- a
Nodeobject.
-
cloneNode
cloneNode.
-
setOwnerDocument
Description copied from interface:NodesetOwnerDocument.
- Specified by:
setOwnerDocumentin interfaceNode- Parameters:
document- aDocumentobject.
-
setOwnerDocument
Description copied from interface:NodesetOwnerDocument.
- Specified by:
setOwnerDocumentin interfaceNode- Parameters:
value- aDocumentobject.deep- a boolean.
-
contains
Returns true if other is an inclusive descendant of node, and false otherwise. -
addEventListener
addEventListener.
- Specified by:
addEventListenerin interfaceEventTarget- Parameters:
type- aStringobject.listener- aFunctionobject.
-
addEventListener
addEventListener.
- Specified by:
addEventListenerin interfaceEventTarget- Parameters:
type- aStringobject.listener- aFunctionobject.useCapture- a boolean.
-
removeEventListener
removeEventListener.
- Specified by:
removeEventListenerin interfaceEventTarget- Parameters:
type- aStringobject.listener- aFunctionobject.
-
removeEventListener
removeEventListener.
- Specified by:
removeEventListenerin interfaceEventTarget- Parameters:
type- aStringobject.listener- aFunctionobject.useCapture- a boolean.
-
dispatchEvent
dispatchEvent.
- Specified by:
dispatchEventin interfaceEventTarget- Parameters:
element- aNodeobject.evt- aEventobject.- Returns:
- a boolean.
-
dispatchEvent
Description copied from interface:EventTargetdispatchEvent.
- Specified by:
dispatchEventin interfaceEventTarget- Parameters:
evt- aEventobject.- Returns:
- a boolean.
- Throws:
EventException- if any.
-
getChildElementCount
public int getChildElementCount()getChildElementCount.
- Specified by:
getChildElementCountin interfaceParentNode- Returns:
- a
Integerobject.
-
getChildren
Returns the child elements.- Specified by:
getChildrenin interfaceParentNode- Returns:
- a
HTMLCollectionobject.
-
getFirstElementChild
Returns the first child that is an element, and null otherwise.- Specified by:
getFirstElementChildin interfaceParentNode- Returns:
- a
Elementobject.
-
getLastElementChild
Returns the last child that is an element, and null otherwise.- Specified by:
getLastElementChildin interfaceParentNode- Returns:
- a
Elementobject.
-
querySelector
Returns the first element that is a descendant of node that matches selectors.- Specified by:
querySelectorin interfaceParentNode- Parameters:
selectors- aStringobject.- Returns:
- a
Elementobject.
-
querySelectorAll
Returns all element descendants of node that match selectors.- Specified by:
querySelectorAllin interfaceParentNode- Parameters:
selectors- aStringobject.- Returns:
- a
NodeListobject.
-
getURL
Sets or gets the URL for the current document. -
getActiveElement
Gets the object that has the focus when the parent document has focus.- Specified by:
getActiveElementin interfaceDocument- Returns:
- a
Elementobject.
-
getall
Returns a reference to the collection of elements contained by the object.- Specified by:
getallin interfaceDocument- Returns:
- a
HTMLAllCollectionobject.
-
getAnchors
Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order.- Specified by:
getAnchorsin interfaceDocument- Returns:
- a
HTMLCollectionobject.
-
getApplets
Retrieves a collection of all applet objects in the document.- Specified by:
getAppletsin interfaceDocument- Returns:
- a
HTMLCollectionobject.
-
getCommands
getCommands.
- Specified by:
getCommandsin interfaceDocument- Returns:
- a
HTMLCollectionobject.
-
getBgColor
Deprecated. Sets or retrieves a value that indicates the background color behind the object.- Specified by:
getBgColorin interfaceDocument- Returns:
- a
Stringobject.
-
setBgColor
setBgColor.
- Specified by:
setBgColorin interfaceDocument- Parameters:
bgColor- aStringobject.
-
getBody
Specifies the beginning and end of the document body.- Specified by:
getBodyin interfaceDocument- Returns:
- a
HTMLElementobject.
-
setBody
setBody.
- Specified by:
setBodyin interfaceDocument- Parameters:
body- aHTMLElementobject.
-
getCharacterSet
Returns document's encoding.- Specified by:
getCharacterSetin interfaceDocument- Returns:
- a
Stringobject.
-
getCharset
Gets or sets the character set used to encode the object.- Specified by:
getCharsetin interfaceDocument- Returns:
- a
Stringobject.
-
getCompatMode
Gets a value that indicates whether standards-compliant mode is switched on for the object.- Specified by:
getCompatModein interfaceDocument- Returns:
- a
Stringobject.
-
getContentType
Returns document's content type.- Specified by:
getContentTypein interfaceDocument- Returns:
- a
Stringobject.
-
getCookie
Returns the HTTP cookies that apply to the Document. If there are no cookies or cookies can't be applied to this resource, the empty string will be returned.Can be set, to add a new cookie to the element's set of HTTP cookies.
If the contents are sandboxed into a unique origin (e.g. in an iframe with the sandbox attribute), a "SecurityError" DOMException will be thrown on getting and setting.
-
setCookie
setCookie.
-
getCurrentScript
Returns the script element, or the SVG script element, that is currently executing, as long as the element represents a classic script. In the case of reentrant script execution, returns the one that most recently started executing amongst those that have not yet finished executing.Returns null if the Document is not currently executing a script or SVG script element (e.g., because the running script is an event handler, or a timeout), or if the currently executing script or SVG script element represents a module script.
- Specified by:
getCurrentScriptin interfaceDocument- Returns:
- a
HTMLScriptElementobject.
-
getDefaultView
getDefaultView.
- Specified by:
getDefaultViewin interfaceDocument- Returns:
- a
Windowobject.
-
getDesignMode
Sets or gets a value that indicates whether the document can be edited.- Specified by:
getDesignModein interfaceDocument- Returns:
- a
Stringobject.
-
setDesignMode
setDesignMode.
- Specified by:
setDesignModein interfaceDocument- Parameters:
designMode- aStringobject.
-
getDir
Sets or retrieves a value that indicates the reading order of the object. -
setDir
setDir.
-
getDomain
Sets or gets the security domain of the document. -
setDomain
setDomain.
-
getEmbeds
Retrieves a collection of all embed objects in the document.- Specified by:
getEmbedsin interfaceDocument- Returns:
- a
HTMLCollectionobject.
-
getFgColor
Sets or gets the foreground (text) color of the document.- Specified by:
getFgColorin interfaceDocument- Returns:
- a
Stringobject.
-
setFgColor
setFgColor.
- Specified by:
setFgColorin interfaceDocument- Parameters:
fgColor- aStringobject.
-
getForms
Retrieves a collection, in source order, of all form objects in the document.- Specified by:
getFormsin interfaceDocument- Returns:
- a
HTMLCollectionobject.
-
isFullscreen
public boolean isFullscreen()isFullscreen.
- Specified by:
isFullscreenin interfaceDocument- Returns:
- a boolean.
-
isFullscreenEnabled
public boolean isFullscreenEnabled()Returns true if document has the ability to display elements fullscreen and fullscreen is supported, or false otherwise.- Specified by:
isFullscreenEnabledin interfaceDocument- Returns:
- a boolean.
-
getHead
Returns the head element.- Specified by:
getHeadin interfaceDocument- Returns:
- a
HTMLHeadElementobject.
-
isHidden
public boolean isHidden()isHidden.
-
getImages
Retrieves a collection, in source order, of img objects in the document.- Specified by:
getImagesin interfaceDocument- Returns:
- a
HTMLCollectionobject.
-
getLastModified
Gets the date that the page was last modified, if the page supplies one.- Specified by:
getLastModifiedin interfaceDocument- Returns:
- a
Stringobject.
-
getLinks
Retrieves a collection of all a objects that specify the href property and all area objects in the document.- Specified by:
getLinksin interfaceDocument- Returns:
- a
HTMLCollectionobject.
-
getLocation
Contains information about the current URL.- Specified by:
getLocationin interfaceDocument- Returns:
- a
Locationobject.
-
setLocation
setLocation.
- Specified by:
setLocationin interfaceDocument- Parameters:
location- aLocationobject.
-
getOrigin
Returns document's origin. -
getPlugins
Return an HTMLCollection of the embed elements in the Document.- Specified by:
getPluginsin interfaceDocument- Returns:
- a
HTMLCollectionobject.
-
getReadyState
Retrieves a value that indicates the current state of the object.- Specified by:
getReadyStatein interfaceDocument- Returns:
- a
DocumentReadyStateobject.
-
getReferrer
Gets the URL of the location that referred the user to the current page.- Specified by:
getReferrerin interfaceDocument- Returns:
- a
Stringobject.
-
getScripts
Retrieves a collection of all script objects in the document.- Specified by:
getScriptsin interfaceDocument- Returns:
- a
HTMLCollectionobject.
-
getScrollingElement
getScrollingElement.
- Specified by:
getScrollingElementin interfaceDocument- Returns:
- a
Elementobject.
-
getTitle
Contains the title of the document. -
setTitle
setTitle.
-
getVisibilityState
getVisibilityState.
- Specified by:
getVisibilityStatein interfaceDocument- Returns:
- a
VisibilityStateobject.
-
caretRangeFromPoint
caretRangeFromPoint.
- Specified by:
caretRangeFromPointin interfaceDocument- Parameters:
x- a double.y- a double.- Returns:
- a
Rangeobject.
-
clear
public void clear()clear.
-
close
public void close()Closes an output stream and forces the sent data to display. -
createElementNS
Returns an element with namespace. Its namespace prefix will be everything before ":" (U+003E) in qualifiedName or null. Its local name will be everything after ":" (U+003E) in qualifiedName or qualifiedName.If localName does not match the Name production an "InvalidCharacterError" DOMException will be thrown.
If one of the following conditions is true a "NamespaceError" DOMException will be thrown:
localName does not match the QName production. Namespace prefix is not null and namespace is the empty string. Namespace prefix is "xml" and namespace is not the XML namespace. qualifiedName or namespace prefix is "xmlns" and namespace is not the XMLNS namespace. namespace is the XMLNS namespace and neither qualifiedName nor namespace prefix is "xmlns".
When supplied, options's is can be used to create a customized built-in element.
-
createEvent
createEvent.
- Specified by:
createEventin interfaceDocument- Parameters:
eventInterface- aStringobject.- Returns:
- a
Eventobject.
-
createNodeIterator
Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.- Specified by:
createNodeIteratorin interfaceDocumentTraversal- Parameters:
root- aNodeobject.- Throws:
DOMException
-
createNodeIterator
Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.- Specified by:
createNodeIteratorin interfaceDocumentTraversal- Parameters:
root- aNodeobject.whatToShow- aIntegerobject.- Throws:
DOMException
-
createNodeIterator
Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.- Specified by:
createNodeIteratorin interfaceDocumentTraversal- Parameters:
root- aNodeobject.filter- aNodeFilterobject.- Throws:
DOMException
-
createNodeIterator
public NodeIterator createNodeIterator(Node root, int whatToShow, NodeFilter filter) throws DOMException Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.- Specified by:
createNodeIteratorin interfaceDocumentTraversal- Parameters:
root- aNodeobject.whatToShow- aIntegerobject.filter- aNodeFilterobject.- Throws:
DOMException
-
createRange
Returns an empty range object that has both of its boundary points positioned at the beginning of the document.- Specified by:
createRangein interfaceDocumentRange- Returns:
- a
Rangeobject.
-
createTreeWalker
createTreeWalker.
- Specified by:
createTreeWalkerin interfaceDocumentTraversal- Parameters:
root- aNodeobject.- Throws:
DOMException
-
createTreeWalker
createTreeWalker.
- Specified by:
createTreeWalkerin interfaceDocumentTraversal- Parameters:
root- aNodeobject.whatToShow- aIntegerobject.- Throws:
DOMException
-
createTreeWalker
createTreeWalker.
- Specified by:
createTreeWalkerin interfaceDocumentTraversal- Parameters:
root- aNodeobject.filter- aNodeFilterobject.- Throws:
DOMException
-
createTreeWalker
public TreeWalker createTreeWalker(Node root, int whatToShow, NodeFilter filter) throws DOMException Description copied from interface:DocumentTraversalcreateTreeWalker.
- Specified by:
createTreeWalkerin interfaceDocumentTraversal- Parameters:
root- aNodeobject.whatToShow- aIntegerobject.filter- aNodeFilterobject.- Throws:
DOMException
-
elementFromPoint
Returns the element for the specified x coordinate and the specified y coordinate.- Specified by:
elementFromPointin interfaceDocument- Parameters:
x- The x-offsety- The y-offset- Returns:
- a
Elementobject.
-
execCommand
Executes a command on the current document, current selection, or the given range.- Specified by:
execCommandin interfaceDocument- Parameters:
commandId- String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script.showUI- Display the user interface, defaults to false.value- Value to assign.- Returns:
- a boolean.
-
execCommand
execCommand.
- Specified by:
execCommandin interfaceDocument- Parameters:
commandId- aStringobject.showUI- a boolean.- Returns:
- a boolean.
-
execCommand
execCommand.
- Specified by:
execCommandin interfaceDocument- Parameters:
commandId- aStringobject.- Returns:
- a boolean.
-
getElementsByClassName
Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.- Specified by:
getElementsByClassNamein interfaceDocument- Parameters:
classNames- aStringobject.- Returns:
- a
HTMLCollectionobject.
-
getElementsByName
Gets a collection of objects based on the value of the NAME or ID attribute.- Specified by:
getElementsByNamein interfaceDocument- Parameters:
elementName- Gets a collection of objects based on the value of the NAME or ID attribute.- Returns:
- a
HTMLCollectionobject.
-
getSelection
Returns an object representing the current selection of the document that is loaded into the object displaying a webpage.- Specified by:
getSelectionin interfaceDocument- Returns:
- a
Selectionobject.
-
hasFocus
public boolean hasFocus()Gets a value indicating whether the object currently has focus. -
open
Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method.- Specified by:
openin interfaceDocument- Parameters:
url- Specifies a MIME type for the document.name- Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element.features- Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported.replace- Specifies whether the existing entry for the document is replaced in the history list.- Returns:
- a
Documentobject.
-
open
open.
-
open
open.
-
open
open.
-
open
open.
-
queryCommandEnabled
Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document.- Specified by:
queryCommandEnabledin interfaceDocument- Parameters:
commandId- Specifies a command identifier.- Returns:
- a boolean.
-
queryCommandIndeterm
Returns a Boolean value that indicates whether the specified command is in the indeterminate state.- Specified by:
queryCommandIndetermin interfaceDocument- Parameters:
commandId- String that specifies a command identifier.- Returns:
- a boolean.
-
queryCommandState
Returns a Boolean value that indicates the current state of the command.- Specified by:
queryCommandStatein interfaceDocument- Parameters:
commandId- String that specifies a command identifier.- Returns:
- a boolean.
-
queryCommandSupported
Returns a Boolean value that indicates whether the current command is supported on the current range.- Specified by:
queryCommandSupportedin interfaceDocument- Parameters:
commandId- Specifies a command identifier.- Returns:
- a boolean.
-
queryCommandValue
Returns the current value of the document, range, or current selection for the given command.- Specified by:
queryCommandValuein interfaceDocument- Parameters:
commandId- String that specifies a command identifier.- Returns:
- a
Stringobject.
-
releaseEvents
public void releaseEvents()releaseEvents.
- Specified by:
releaseEventsin interfaceDocument
-
write
Writes one or more HTML expressions to a document in the specified window. -
writeln
Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. -
createExpression
createExpression.
- Specified by:
createExpressionin interfaceDocument- Returns:
- a
XPathExpressionobject.
-
createNSResolver
createNSResolver.
- Specified by:
createNSResolverin interfaceDocument- Parameters:
nodeResolver- aNodeobject.- Returns:
- a
XPathNSResolverobject.
-
evaluate
public XPathResult evaluate(String expression, Node contextNode, XPathNSResolver resolver, short type, Object result) evaluate.
- Specified by:
evaluatein interfaceDocument- Parameters:
expression- aStringobject.contextNode- aNodeobject.resolver- aXPathNSResolverobject.type- a short.result- aObjectobject.- Returns:
- a
XPathResultobject.
-
isXml
public boolean isXml() -
setXml
public void setXml(boolean xml) -
toString
-
getDocumentItem
Description copied from interface:ModelNodegetDocumentItem.
- Specified by:
getDocumentItemin interfaceModelNode- Parameters:
name- aStringobject.- Returns:
- a
Objectobject.
-
getFullURL
Description copied from interface:ModelNodegetFullURL.
- Specified by:
getFullURLin interfaceModelNode- Parameters:
spec- aStringobject.- Returns:
- a
URLobject. - Throws:
Exception- if any.
-
getParentModelNode
Description copied from interface:ModelNodegetParentModelNode.
- Specified by:
getParentModelNodein interfaceModelNode- Returns:
- a
ModelNodeobject.
-
isEqualOrDescendentOf
Description copied from interface:ModelNodeisEqualOrDescendentOf.
- Specified by:
isEqualOrDescendentOfin interfaceModelNode- Parameters:
otherNode- aModelNodeobject.- Returns:
- a boolean.
-
getRenderState
Description copied from interface:ModelNodegetRenderState.
- Specified by:
getRenderStatein interfaceModelNode
-
setDocumentItem
Description copied from interface:ModelNodeSets a document item. A radio button, for example, can use this to set button group state.- Specified by:
setDocumentItemin interfaceModelNode- Parameters:
name- aStringobject.value- aObjectobject.
-
warn
Description copied from interface:ModelNodewarn.
-