Class XMLDocument
- All Implemented Interfaces:
EventTarget
,Document
,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_URI
Fields 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addEventListener
(String type, Function listener) addEventListener.void
addEventListener
(String type, Function listener, boolean useCapture) addEventListener.Moves node from another document and returns it.appendChild
(Node newChild) appendChild.caretRangeFromPoint
(double x, double y) caretRangeFromPoint.void
clear()
clear.cloneNode.cloneNode
(boolean deep) Returns a copy of node.void
close()
Closes an output stream and forces the sent data to display.short
compareDocumentPosition
(Node other) compareDocumentPosition.boolean
Returns 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.boolean
dispatchEvent
(Event evt) dispatchEvent.boolean
dispatchEvent
(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.boolean
execCommand
(String commandId) execCommand.boolean
execCommand
(String commandId, boolean showUI) execCommand.boolean
execCommand
(String commandId, boolean showUI, String value) Executes a command on the current document, current selection, or the given range.Gets 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.int
getChildElementCount.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.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.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.int
Returns the type of node.getNodeValue.Returns document's origin.Returns the node document.Returns the parent element.Returns the parent.Return an HTMLCollection of the embed elements in the Document.Returns prefix.Returns the previous sibling.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.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.boolean
getStrictErrorChecking.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.boolean
getXmlStandalone.getXmlVersion.boolean
Returns true if element has attributes, and false otherwise.boolean
Returns whether node has children.boolean
hasFocus()
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.boolean
isDefaultNamespace
(String namespaceURI) isDefaultNamespace.boolean
isEqualNode
(Node arg) Returns whether node and otherNode have the same properties.boolean
isFullscreen.boolean
Returns true if document has the ability to display elements fullscreen and fullscreen is supported, or false otherwise.boolean
isHidden()
isHidden.boolean
Returns true if node is connected and false otherwise.boolean
isSameNode
(Node other) isSameNode.boolean
isSupported
(String xml, String s) boolean
isXml()
static XMLDocument
Load XML fileLoad XML filelookupNamespaceURI
(String prefix) lookupNamespaceURI.lookupPrefix
(String namespaceURI) lookupPrefix.void
Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.void
normalizeDocument.open()
open.open.open.open.Opens a new window and loads a document specified by a given URL.prepend.prependChild
(Node newChild) prependChild.boolean
queryCommandEnabled
(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.boolean
queryCommandIndeterm
(String commandId) Returns a Boolean value that indicates whether the specified command is in the indeterminate state.boolean
queryCommandState
(String commandId) Returns a Boolean value that indicates the current state of the command.boolean
queryCommandSupported
(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.void
releaseEvents.removeChild
(Node oldChild) removeChild.void
removeEventListener
(String type, Function listener) removeEventListener.void
removeEventListener
(String type, Function listener, boolean useCapture) removeEventListener.renameNode
(Node node, String namespaceURI, String qualifiedName) replaceChild
(Node newChild, Node oldChild) replaceChild.void
setBgColor
(String bgColor) setBgColor.void
setBody
(HTMLElement body) setBody.void
setCookie.void
setDesignMode
(String designMode) setDesignMode.void
setDir.void
setDocumentURI
(String documentURI) setDocumentURI.void
setDomain.void
setFgColor
(String fgColor) setFgColor.void
setLocation
(Location location) setLocation.void
setNodeValue
(String nodeValue) setNodeValue.void
setOwnerDocument
(Document document) setOwnerDocument.void
setPrefix.void
setStrictErrorChecking
(boolean strictErrorChecking) setStrictErrorChecking.void
setTextContent
(String textContent) setTextContent.void
setTitle.setUserData
(String key, Object data, UserDataHandler handler) setUserData.void
setXml
(boolean xml) void
setXmlStandalone
(boolean xmlStandalone) setXmlStandalone.void
setXmlVersion
(String xmlVersion) setXmlVersion.toString()
void
Writes one or more HTML expressions to a document in the specified window.void
Writes 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:
getElementsByTagName
in interfaceDocument
- Parameters:
tagname
- Specifies the name of an element.- Returns:
- a
HTMLCollection
object.
-
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:
getElementById
in interfaceDocument
- Specified by:
getElementById
in interfaceNonElementParentNode
- Parameters:
id
- aString
object.- Returns:
- a
Element
object.
-
appendChild
appendChild.
- Specified by:
appendChild
in interfaceNode
- Parameters:
newChild
- aNode
object.- Returns:
- a
Node
object.
-
prependChild
prependChild.
- Specified by:
prependChild
in interfaceNode
- Parameters:
newChild
- aNode
object.- Returns:
- a
Node
object.
-
prepend
prepend.
-
cloneNode
Returns a copy of node. If deep is true, the copy also includes the node's descendants. -
compareDocumentPosition
compareDocumentPosition.
- Specified by:
compareDocumentPosition
in interfaceNode
- Parameters:
other
- aNode
object.- Returns:
- a short.
-
isSupported
- Specified by:
isSupported
in interfaceNode
-
hasAttributes
public boolean hasAttributes()Description copied from interface:Node
Returns true if element has attributes, and false otherwise.- Specified by:
hasAttributes
in interfaceNode
- Returns:
- a boolean.
-
getFeature
- Specified by:
getFeature
in interfaceNode
-
getBaseURI
Returns node's node document's document base URL.- Specified by:
getBaseURI
in interfaceNode
- Returns:
- a
String
object.
-
getChildNodes
Returns the children.- Specified by:
getChildNodes
in interfaceNode
- Returns:
- a
NodeList
object.
-
getFirstChild
Returns the first child.- Specified by:
getFirstChild
in interfaceNode
- Returns:
- a
Node
object.
-
getLastChild
Returns the last child.- Specified by:
getLastChild
in interfaceNode
- Returns:
- a
Node
object.
-
getLocalName
getLocalName.
- Specified by:
getLocalName
in interfaceNode
- Returns:
- a
String
object.
-
getNamespaceURI
getNamespaceURI.
- Specified by:
getNamespaceURI
in interfaceNode
- Returns:
- a
String
object.
-
getNextSibling
Returns the next sibling.- Specified by:
getNextSibling
in interfaceNode
- Returns:
- a
Node
object.
-
getNodeName
Returns a string appropriate for the type of node.- Specified by:
getNodeName
in interfaceNode
- Returns:
- a
String
object.
-
getNodeType
public int getNodeType()Returns the type of node.- Specified by:
getNodeType
in interfaceNode
- Returns:
- a
Integer
object.
-
getNodeValue
getNodeValue.
- Specified by:
getNodeValue
in interfaceNode
- Returns:
- a
String
object.
-
getOwnerDocument
Returns the node document. Returns null for documents.- Specified by:
getOwnerDocument
in interfaceNode
- Returns:
- a
Document
object.
-
getParentNode
Returns the parent.- Specified by:
getParentNode
in interfaceNode
- Returns:
- a
Node
object.
-
getPrefix
Returns prefix. -
getPreviousSibling
Returns the previous sibling.- Specified by:
getPreviousSibling
in interfaceNode
- Returns:
- a
Node
object.
-
getTextContent
getTextContent.
- Specified by:
getTextContent
in interfaceNode
- Returns:
- a
String
object.
-
getUserData
getUserData.
- Specified by:
getUserData
in interfaceNode
- Parameters:
key
- aString
object.- Returns:
- a
Object
object.
-
hasChildNodes
public boolean hasChildNodes()Returns whether node has children.- Specified by:
hasChildNodes
in interfaceNode
- Returns:
- a boolean.
-
insertBefore
insertBefore.
- Specified by:
insertBefore
in interfaceNode
- Parameters:
newChild
- aNode
object.refChild
- aNode
object.- Returns:
- a
Node
object.
-
isDefaultNamespace
isDefaultNamespace.
- Specified by:
isDefaultNamespace
in interfaceNode
- Parameters:
namespaceURI
- aString
object.- Returns:
- a boolean.
-
isEqualNode
Returns whether node and otherNode have the same properties.- Specified by:
isEqualNode
in interfaceNode
- Parameters:
arg
- aNode
object.- Returns:
- a boolean.
-
isSameNode
isSameNode.
- Specified by:
isSameNode
in interfaceNode
- Parameters:
other
- aNode
object.- Returns:
- a boolean.
-
lookupNamespaceURI
lookupNamespaceURI.
- Specified by:
lookupNamespaceURI
in interfaceNode
- Parameters:
prefix
- aString
object.- Returns:
- a
String
object.
-
lookupPrefix
lookupPrefix.
- Specified by:
lookupPrefix
in interfaceNode
- Parameters:
namespaceURI
- aString
object.- Returns:
- a
String
object.
-
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:
removeChild
in interfaceNode
- Parameters:
oldChild
- aNode
object.- Returns:
- a
Node
object.
-
replaceChild
replaceChild.
- Specified by:
replaceChild
in interfaceNode
- Parameters:
newChild
- aNode
object.oldChild
- aNode
object.- Returns:
- a
Node
object.
-
getAttributes
Description copied from interface:Node
getAttributes.
- Specified by:
getAttributes
in interfaceNode
- Returns:
- a
NamedNodeMap
object.
-
setNodeValue
setNodeValue.
- Specified by:
setNodeValue
in interfaceNode
- Parameters:
nodeValue
- aString
object.
-
setPrefix
setPrefix.
-
setTextContent
setTextContent.
- Specified by:
setTextContent
in interfaceNode
- Parameters:
textContent
- aString
object.
-
setUserData
setUserData.
- Specified by:
setUserData
in interfaceNode
- Parameters:
key
- aString
object.data
- aObject
object.handler
- aUserDataHandler
object.- Returns:
- a
Object
object.
-
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:
createEntityReference
in interfaceDocument
-
renameNode
- Specified by:
renameNode
in interfaceDocument
-
createAttribute
Creates an attribute object with a specified name.- Specified by:
createAttribute
in interfaceDocument
- Parameters:
name
- String that sets the attribute object's name.- Returns:
- a
Attr
object.
-
createAttributeNS
createAttributeNS.
- Specified by:
createAttributeNS
in interfaceDocument
- Parameters:
namespaceURI
- aString
object.qualifiedName
- aString
object.- Returns:
- a
Attr
object.
-
createCDATASection
Returns a CDATASection node whose data is data.- Specified by:
createCDATASection
in interfaceDocument
- Parameters:
data
- aString
object.- Returns:
- a
CDATASection
object.
-
createComment
Creates a comment object with the specified data.- Specified by:
createComment
in interfaceDocument
- Parameters:
data
- Sets the comment object's data.- Returns:
- a
Comment
object.
-
createDocumentFragment
Creates a new document.- Specified by:
createDocumentFragment
in interfaceDocument
- Returns:
- a
DocumentFragment
object.
-
createElement
Creates an instance of the element for the specified tag.- Specified by:
createElement
in interfaceDocument
- Parameters:
tagName
- The name of an element.- Returns:
- a
Element
object.
-
createElementNS
createElementNS.
- Specified by:
createElementNS
in interfaceDocument
- Parameters:
namespaceURI
- aString
object.qualifiedName
- aString
object.- Returns:
- a
Element
object.
-
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:
createProcessingInstruction
in interfaceDocument
- Parameters:
target
- aString
object.data
- aString
object.- Returns:
- a
ProcessingInstruction
object.
-
createTextNode
Creates a text string from the specified value.- Specified by:
createTextNode
in interfaceDocument
- Parameters:
data
- String that specifies the nodeValue property of the text node.- Returns:
- a
Text
object.
-
getDoctype
Gets an object representing the document type declaration associated with the current document.- Specified by:
getDoctype
in interfaceDocument
- Returns:
- a
DocumentType
object.
-
getDocumentElement
Gets a reference to the root node of the document.- Specified by:
getDocumentElement
in interfaceDocument
- Returns:
- a
Element
object.
-
getDocumentURI
Returns document's URL.- Specified by:
getDocumentURI
in interfaceDocument
- Returns:
- a
String
object.
-
getDomConfig
getDomConfig.
- Specified by:
getDomConfig
in interfaceDocument
- Returns:
- a
DOMConfiguration
object.
-
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:
getElementsByTagNameNS
in interfaceDocument
- Parameters:
namespaceURI
- aString
object.localName
- aString
object.- Returns:
- a
HTMLCollection
object.
-
getImplementation
Gets the implementation object of the current document.- Specified by:
getImplementation
in interfaceDocument
- Returns:
- a
DOMImplementation
object.
-
getInputEncoding
Returns the character encoding used to create the webpage that is loaded into the document object.- Specified by:
getInputEncoding
in interfaceDocument
- Returns:
- a
String
object.
-
getStrictErrorChecking
public boolean getStrictErrorChecking()getStrictErrorChecking.
- Specified by:
getStrictErrorChecking
in interfaceDocument
- Returns:
- a boolean.
-
getXmlEncoding
getXmlEncoding.
- Specified by:
getXmlEncoding
in interfaceDocument
- Returns:
- a
String
object.
-
getXmlStandalone
public boolean getXmlStandalone()getXmlStandalone.
- Specified by:
getXmlStandalone
in interfaceDocument
- Returns:
- a boolean.
-
getXmlVersion
getXmlVersion.
- Specified by:
getXmlVersion
in interfaceDocument
- Returns:
- a
String
object.
-
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:
importNode
in interfaceDocument
- Parameters:
importedNode
- aNode
object.deep
- a boolean.- Returns:
- a
Node
object.
-
normalizeDocument
public void normalizeDocument()normalizeDocument.
- Specified by:
normalizeDocument
in interfaceDocument
-
setDocumentURI
setDocumentURI.
- Specified by:
setDocumentURI
in interfaceDocument
- Parameters:
documentURI
- aString
object.
-
setStrictErrorChecking
public void setStrictErrorChecking(boolean strictErrorChecking) setStrictErrorChecking.
- Specified by:
setStrictErrorChecking
in interfaceDocument
- Parameters:
strictErrorChecking
- a boolean.
-
setXmlStandalone
public void setXmlStandalone(boolean xmlStandalone) setXmlStandalone.
- Specified by:
setXmlStandalone
in interfaceDocument
- Parameters:
xmlStandalone
- a boolean.
-
setXmlVersion
setXmlVersion.
- Specified by:
setXmlVersion
in interfaceDocument
- Parameters:
xmlVersion
- aString
object.
-
isIsConnected
public boolean isIsConnected()Returns true if node is connected and false otherwise.- Specified by:
isIsConnected
in interfaceNode
- Returns:
- a boolean.
-
getParentElement
Returns the parent element.- Specified by:
getParentElement
in interfaceNode
- Returns:
- a
HTMLElement
object.
-
getRootNode
Returns node's root.- Specified by:
getRootNode
in interfaceNode
- Returns:
- a
Node
object.
-
cloneNode
cloneNode.
-
setOwnerDocument
Description copied from interface:Node
setOwnerDocument.
- Specified by:
setOwnerDocument
in interfaceNode
- Parameters:
document
- aDocument
object.
-
contains
Returns true if other is an inclusive descendant of node, and false otherwise. -
addEventListener
addEventListener.
- Specified by:
addEventListener
in interfaceEventTarget
- Parameters:
type
- aString
object.listener
- aFunction
object.
-
addEventListener
addEventListener.
- Specified by:
addEventListener
in interfaceEventTarget
- Parameters:
type
- aString
object.listener
- aFunction
object.useCapture
- a boolean.
-
removeEventListener
removeEventListener.
- Specified by:
removeEventListener
in interfaceEventTarget
- Parameters:
type
- aString
object.listener
- aFunction
object.
-
removeEventListener
removeEventListener.
- Specified by:
removeEventListener
in interfaceEventTarget
- Parameters:
type
- aString
object.listener
- aFunction
object.useCapture
- a boolean.
-
dispatchEvent
dispatchEvent.
- Specified by:
dispatchEvent
in interfaceEventTarget
- Parameters:
element
- aNode
object.evt
- aEvent
object.- Returns:
- a boolean.
-
dispatchEvent
Description copied from interface:EventTarget
dispatchEvent.
- Specified by:
dispatchEvent
in interfaceEventTarget
- Parameters:
evt
- aEvent
object.- Returns:
- a boolean.
- Throws:
EventException
- if any.
-
getChildElementCount
public int getChildElementCount()getChildElementCount.
- Specified by:
getChildElementCount
in interfaceParentNode
- Returns:
- a
Integer
object.
-
getChildren
Returns the child elements.- Specified by:
getChildren
in interfaceParentNode
- Returns:
- a
HTMLCollection
object.
-
getFirstElementChild
Returns the first child that is an element, and null otherwise.- Specified by:
getFirstElementChild
in interfaceParentNode
- Returns:
- a
Element
object.
-
getLastElementChild
Returns the last child that is an element, and null otherwise.- Specified by:
getLastElementChild
in interfaceParentNode
- Returns:
- a
Element
object.
-
querySelector
Returns the first element that is a descendant of node that matches selectors.- Specified by:
querySelector
in interfaceParentNode
- Parameters:
selectors
- aString
object.- Returns:
- a
Element
object.
-
querySelectorAll
Returns all element descendants of node that match selectors.- Specified by:
querySelectorAll
in interfaceParentNode
- Parameters:
selectors
- aString
object.- Returns:
- a
NodeList
object.
-
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:
getActiveElement
in interfaceDocument
- Returns:
- a
Element
object.
-
getall
Returns a reference to the collection of elements contained by the object.- Specified by:
getall
in interfaceDocument
- Returns:
- a
HTMLAllCollection
object.
-
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:
getAnchors
in interfaceDocument
- Returns:
- a
HTMLCollection
object.
-
getApplets
Retrieves a collection of all applet objects in the document.- Specified by:
getApplets
in interfaceDocument
- Returns:
- a
HTMLCollection
object.
-
getCommands
getCommands.
- Specified by:
getCommands
in interfaceDocument
- Returns:
- a
HTMLCollection
object.
-
getBgColor
Deprecated. Sets or retrieves a value that indicates the background color behind the object.- Specified by:
getBgColor
in interfaceDocument
- Returns:
- a
String
object.
-
setBgColor
setBgColor.
- Specified by:
setBgColor
in interfaceDocument
- Parameters:
bgColor
- aString
object.
-
getBody
Specifies the beginning and end of the document body.- Specified by:
getBody
in interfaceDocument
- Returns:
- a
HTMLElement
object.
-
setBody
setBody.
- Specified by:
setBody
in interfaceDocument
- Parameters:
body
- aHTMLElement
object.
-
getCharacterSet
Returns document's encoding.- Specified by:
getCharacterSet
in interfaceDocument
- Returns:
- a
String
object.
-
getCharset
Gets or sets the character set used to encode the object.- Specified by:
getCharset
in interfaceDocument
- Returns:
- a
String
object.
-
getCompatMode
Gets a value that indicates whether standards-compliant mode is switched on for the object.- Specified by:
getCompatMode
in interfaceDocument
- Returns:
- a
String
object.
-
getContentType
Returns document's content type.- Specified by:
getContentType
in interfaceDocument
- Returns:
- a
String
object.
-
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:
getCurrentScript
in interfaceDocument
- Returns:
- a
HTMLScriptElement
object.
-
getDefaultView
getDefaultView.
- Specified by:
getDefaultView
in interfaceDocument
- Returns:
- a
Window
object.
-
getDesignMode
Sets or gets a value that indicates whether the document can be edited.- Specified by:
getDesignMode
in interfaceDocument
- Returns:
- a
String
object.
-
setDesignMode
setDesignMode.
- Specified by:
setDesignMode
in interfaceDocument
- Parameters:
designMode
- aString
object.
-
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:
getEmbeds
in interfaceDocument
- Returns:
- a
HTMLCollection
object.
-
getFgColor
Sets or gets the foreground (text) color of the document.- Specified by:
getFgColor
in interfaceDocument
- Returns:
- a
String
object.
-
setFgColor
setFgColor.
- Specified by:
setFgColor
in interfaceDocument
- Parameters:
fgColor
- aString
object.
-
getForms
Retrieves a collection, in source order, of all form objects in the document.- Specified by:
getForms
in interfaceDocument
- Returns:
- a
HTMLCollection
object.
-
isFullscreen
public boolean isFullscreen()isFullscreen.
- Specified by:
isFullscreen
in 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:
isFullscreenEnabled
in interfaceDocument
- Returns:
- a boolean.
-
getHead
Returns the head element.- Specified by:
getHead
in interfaceDocument
- Returns:
- a
HTMLHeadElement
object.
-
isHidden
public boolean isHidden()isHidden.
-
getImages
Retrieves a collection, in source order, of img objects in the document.- Specified by:
getImages
in interfaceDocument
- Returns:
- a
HTMLCollection
object.
-
getLastModified
Gets the date that the page was last modified, if the page supplies one.- Specified by:
getLastModified
in interfaceDocument
- Returns:
- a
String
object.
-
getLinks
Retrieves a collection of all a objects that specify the href property and all area objects in the document.- Specified by:
getLinks
in interfaceDocument
- Returns:
- a
HTMLCollection
object.
-
getLocation
Contains information about the current URL.- Specified by:
getLocation
in interfaceDocument
- Returns:
- a
Location
object.
-
setLocation
setLocation.
- Specified by:
setLocation
in interfaceDocument
- Parameters:
location
- aLocation
object.
-
getOrigin
Returns document's origin. -
getPlugins
Return an HTMLCollection of the embed elements in the Document.- Specified by:
getPlugins
in interfaceDocument
- Returns:
- a
HTMLCollection
object.
-
getReadyState
Retrieves a value that indicates the current state of the object.- Specified by:
getReadyState
in interfaceDocument
- Returns:
- a
DocumentReadyState
object.
-
getReferrer
Gets the URL of the location that referred the user to the current page.- Specified by:
getReferrer
in interfaceDocument
- Returns:
- a
String
object.
-
getScripts
Retrieves a collection of all script objects in the document.- Specified by:
getScripts
in interfaceDocument
- Returns:
- a
HTMLCollection
object.
-
getScrollingElement
getScrollingElement.
- Specified by:
getScrollingElement
in interfaceDocument
- Returns:
- a
Element
object.
-
getTitle
Contains the title of the document. -
setTitle
setTitle.
-
getVisibilityState
getVisibilityState.
- Specified by:
getVisibilityState
in interfaceDocument
- Returns:
- a
VisibilityState
object.
-
caretRangeFromPoint
caretRangeFromPoint.
- Specified by:
caretRangeFromPoint
in interfaceDocument
- Parameters:
x
- a double.y
- a double.- Returns:
- a
Range
object.
-
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:
createEvent
in interfaceDocument
- Parameters:
eventInterface
- aString
object.- Returns:
- a
Event
object.
-
createNodeIterator
Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.- Specified by:
createNodeIterator
in interfaceDocumentTraversal
- Parameters:
root
- aNode
object.- Throws:
DOMException
-
createNodeIterator
Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.- Specified by:
createNodeIterator
in interfaceDocumentTraversal
- Parameters:
root
- aNode
object.whatToShow
- aInteger
object.- Throws:
DOMException
-
createNodeIterator
Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.- Specified by:
createNodeIterator
in interfaceDocumentTraversal
- Parameters:
root
- aNode
object.filter
- aNodeFilter
object.- 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:
createNodeIterator
in interfaceDocumentTraversal
- Parameters:
root
- aNode
object.whatToShow
- aInteger
object.filter
- aNodeFilter
object.- Throws:
DOMException
-
createRange
Returns an empty range object that has both of its boundary points positioned at the beginning of the document.- Specified by:
createRange
in interfaceDocumentRange
- Returns:
- a
Range
object.
-
createTreeWalker
createTreeWalker.
- Specified by:
createTreeWalker
in interfaceDocumentTraversal
- Parameters:
root
- aNode
object.- Throws:
DOMException
-
createTreeWalker
createTreeWalker.
- Specified by:
createTreeWalker
in interfaceDocumentTraversal
- Parameters:
root
- aNode
object.whatToShow
- aInteger
object.- Throws:
DOMException
-
createTreeWalker
createTreeWalker.
- Specified by:
createTreeWalker
in interfaceDocumentTraversal
- Parameters:
root
- aNode
object.filter
- aNodeFilter
object.- Throws:
DOMException
-
createTreeWalker
public TreeWalker createTreeWalker(Node root, int whatToShow, NodeFilter filter) throws DOMException Description copied from interface:DocumentTraversal
createTreeWalker.
- Specified by:
createTreeWalker
in interfaceDocumentTraversal
- Parameters:
root
- aNode
object.whatToShow
- aInteger
object.filter
- aNodeFilter
object.- Throws:
DOMException
-
elementFromPoint
Returns the element for the specified x coordinate and the specified y coordinate.- Specified by:
elementFromPoint
in interfaceDocument
- Parameters:
x
- The x-offsety
- The y-offset- Returns:
- a
Element
object.
-
execCommand
Executes a command on the current document, current selection, or the given range.- Specified by:
execCommand
in 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:
execCommand
in interfaceDocument
- Parameters:
commandId
- aString
object.showUI
- a boolean.- Returns:
- a boolean.
-
execCommand
execCommand.
- Specified by:
execCommand
in interfaceDocument
- Parameters:
commandId
- aString
object.- 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:
getElementsByClassName
in interfaceDocument
- Parameters:
classNames
- aString
object.- Returns:
- a
HTMLCollection
object.
-
getElementsByName
Gets a collection of objects based on the value of the NAME or ID attribute.- Specified by:
getElementsByName
in interfaceDocument
- Parameters:
elementName
- Gets a collection of objects based on the value of the NAME or ID attribute.- Returns:
- a
HTMLCollection
object.
-
getSelection
Returns an object representing the current selection of the document that is loaded into the object displaying a webpage.- Specified by:
getSelection
in interfaceDocument
- Returns:
- a
Selection
object.
-
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:
open
in 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
Document
object.
-
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:
queryCommandEnabled
in 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:
queryCommandIndeterm
in 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:
queryCommandState
in 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:
queryCommandSupported
in 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:
queryCommandValue
in interfaceDocument
- Parameters:
commandId
- String that specifies a command identifier.- Returns:
- a
String
object.
-
releaseEvents
public void releaseEvents()releaseEvents.
- Specified by:
releaseEvents
in 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:
createExpression
in interfaceDocument
- Returns:
- a
XPathExpression
object.
-
createNSResolver
createNSResolver.
- Specified by:
createNSResolver
in interfaceDocument
- Parameters:
nodeResolver
- aNode
object.- Returns:
- a
XPathNSResolver
object.
-
evaluate
public XPathResult evaluate(String expression, Node contextNode, XPathNSResolver resolver, short type, Object result) evaluate.
- Specified by:
evaluate
in interfaceDocument
- Parameters:
expression
- aString
object.contextNode
- aNode
object.resolver
- aXPathNSResolver
object.type
- a short.result
- aObject
object.- Returns:
- a
XPathResult
object.
-
isXml
public boolean isXml() -
setXml
public void setXml(boolean xml) -
toString
-