|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.htmlunit.corejs.javascript.ScriptableObject
com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
com.gargoylesoftware.htmlunit.javascript.host.Node
com.gargoylesoftware.htmlunit.javascript.host.EventNode
com.gargoylesoftware.htmlunit.javascript.host.Document
com.gargoylesoftware.htmlunit.javascript.host.xml.XMLDocument
public class XMLDocument
A JavaScript object for XMLDocument.
Field Summary |
---|
Fields inherited from class com.gargoylesoftware.htmlunit.javascript.host.Node |
---|
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE |
Fields inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject |
---|
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST |
Fields inherited from interface net.sourceforge.htmlunit.corejs.javascript.Scriptable |
---|
NOT_FOUND |
Constructor Summary | |
---|---|
XMLDocument()
Creates a new instance. |
|
XMLDocument(WebWindow enclosingWindow)
Creates a new instance, with associated XmlPage. |
Method Summary | |
---|---|
Object |
createCDATASection(String data)
Creates a new createCDATASection. |
Object |
createNode(Object type,
String name,
Object namespaceURI)
Creates a node using the supplied type, name, and namespace. |
Object |
createProcessingInstruction(String target,
String data)
Creates a new ProcessingInstruction. |
boolean |
getAsync()
Returns Whether or not to send the request to the server asynchronously. |
Object |
getElementById(String id)
Returns the element with the specified ID, as long as it is an HTML element; null otherwise. |
HTMLCollection |
getElementsByTagName(String tagName)
Returns all the descendant elements with the specified tag name. |
XMLDOMParseError |
getParseError()
Gets the JavaScript property "parseError" for the document. |
boolean |
getPreserveWhiteSpace()
Gets the current white space handling. |
String |
getXml()
Contains the XML representation of the node and all its descendants. |
protected void |
initParentScope(DomNode domNode,
SimpleScriptable scriptable)
Initialize the parent scope of a newly created scriptable. |
boolean |
load(String xmlSource)
Loads an XML document from the specified location. |
boolean |
loadXML(String strXML)
Loads an XML document using the supplied string. |
SimpleScriptable |
makeScriptableFor(DomNode domNode)
Builds a new the JavaScript object that corresponds to the specified object. |
Object |
nodeFromID(String id)
Since we are not processing DTD, this method always returns null. |
HTMLCollection |
selectNodes(String expression)
Applies the specified XPath expression to this node's context and returns the generated list of matching nodes. |
Object |
selectSingleNode(String expression)
Applies the specified pattern-matching operation to this node's context and returns the first matching node. |
void |
setAsync(boolean async)
Sets the async attribute. |
void |
setPreserveWhiteSpace(boolean preserveWhiteSpace)
Specifies the white space handling. |
void |
setProperty(String name,
String value)
This method is used to set second-level properties on the DOM object. |
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.Document |
---|
captureEvents, createAttribute, createComment, createDocumentFragment, createElement, createElementNS, createNSResolver, createTextNode, evaluate, getBoxObjectFor, getDefaultView, getDesignMode, getDoctype, getDocumentElement, getElementsByTagNameNS, getImplementation, getLocation, getPage, getReferrer, importNode, setDesignMode, setLocation, setWindow |
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.EventNode |
---|
fireEvent, getOnblur, getOnclick, getOncontextmenu, getOndblclick, getOnerror, getOnfocus, getOnfocusin, getOnfocusout, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getOnpropertychange, getOnresize, setOnblur, setOnclick, setOncontextmenu, setOndblclick, setOnerror, setOnfocus, setOnfocusin, setOnfocusout, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnpropertychange, setOnresize |
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.Node |
---|
addEventListener, appendChild, attachEvent, cloneNode, compareDocumentPosition, detachEvent, executeEvent, fireEvent, fireEvent, getAttributes, getChildNodes, getEventHandler, getEventHandlerProp, getFirstChild, getJavaScriptNode, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParent, getParentElement, getParentNode, getPrefix, getPreviousSibling, getTextContent, hasChildNodes, hasEventHandlers, insertBefore, insertBeforeImpl, isSameNode, normalize, removeChild, removeEventListener, replaceChild, setDomNode, setEventHandler, setEventHandlerProp, setNodeValue, setTextContent |
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.SimpleScriptable |
---|
clone, defineFunctionProperties, defineProperty, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, hasInstance, isReadOnlySettable, setCaseSensitive, setDomNode, setHtmlElement |
Methods inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject |
---|
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype, size |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XMLDocument()
public XMLDocument(WebWindow enclosingWindow)
enclosingWindow
- the windowMethod Detail |
---|
public void setAsync(boolean async)
async
- Whether or not to send the request to the server asynchronouslypublic boolean getAsync()
public boolean load(String xmlSource)
xmlSource
- a string containing a URL that specifies the location of the XML file
public boolean loadXML(String strXML)
strXML
- A string containing the XML string to load into this XML document object
This string can contain an entire XML document or a well-formed fragment.
public SimpleScriptable makeScriptableFor(DomNode domNode)
makeScriptableFor
in class SimpleScriptable
domNode
- the DOM node for which a JS object should be created
protected void initParentScope(DomNode domNode, SimpleScriptable scriptable)
initParentScope
in class SimpleScriptable
domNode
- the DOM node for the script objectscriptable
- the script object to initializepublic XMLDOMParseError getParseError()
public String getXml()
getXml
in class Node
public boolean getPreserveWhiteSpace()
public void setPreserveWhiteSpace(boolean preserveWhiteSpace)
preserveWhiteSpace
- white space handlingpublic void setProperty(String name, String value)
name
- the name of the property to be setvalue
- the value of the specified propertypublic HTMLCollection selectNodes(String expression)
expression
- a string specifying an XPath expression
public Object selectSingleNode(String expression)
expression
- a string specifying an XPath expression
public HTMLCollection getElementsByTagName(String tagName)
getElementsByTagName
in class Document
tagName
- the name to search for
public Object getElementById(String id)
id
- the ID to search for
public Object nodeFromID(String id)
id
- the ID to search for
public Object createProcessingInstruction(String target, String data)
target
- the targetdata
- the data
public Object createCDATASection(String data)
data
- the data
public Object createNode(Object type, String name, Object namespaceURI)
type
- a value that uniquely identifies the node typename
- the value for the new node's nodeName propertynamespaceURI
- A string defining the namespace URI.
If specified, the node is created in the context of the namespaceURI parameter
with the prefix specified on the node name.
If the name parameter does not have a prefix, this is treated as the default namespace.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |