|
Oracle® Fusion Middleware Javascript API Reference for Oracle ADF Faces 12c (12.2.1.4.0) E81451-01 |
||||||||
PREV NEXT | FRAMES NO FRAMES Warning: private items are visible |
org.ecmascript.object.Object | +--org.w3c.dom.core.Node
public abstract class Node extends Object
Field Summary |
|
---|---|
public static Number |
|
public NamedNodeMap |
|
public static Number |
|
public NodeList |
|
public static Number |
|
public static Number |
|
public static Number |
|
public static Number |
|
public static Number |
|
public static Number |
|
public static Number |
|
public Node |
|
public Node |
|
public String |
|
public String |
|
public Node |
|
public String |
|
public Number |
|
public String |
|
public static Number |
|
public Document |
|
public Node |
|
public String |
|
public Node |
|
public static Number |
|
public static Number |
|
Fields inherited from org.ecmascript.object.Object |
constructor, prototype |
Method Summary |
|
---|---|
public Node |
|
public Node |
|
public Boolean |
|
public Boolean |
|
public Node |
|
public Boolean |
|
public void |
|
public Node |
|
public Node |
|
Field Detail |
---|
public static Number ATTRIBUTE_NODE
public NamedNodeMap attributes
- Example:
-
<div id="doc">
<div>
Text in the first DIV.
</div>
<div id="DDD" class="secondClass">
Some text in the second DIV.
</div>
<div class="thirdClass">
Some text and <span id="SSS">element</span> in the third DIV.
</div>
<div class="fourthClass">
We can try <i>another elements</i>.
It will be much more <b>interesting</b>.
</div>
<div>
Text in the last DIV.
</div>
</div>
- JavaScript:
- var main = document.getElementById('doc');
- var attrNode = main.childNodes[3].attributes;
- var output = attrNode.length;
public static Number CDATA_SECTION_NODE
public NodeList childNodes
NamedNodeMap
that contains all children of this node. If there are no children, this
is a NodeList
containing no nodes.
- Example:
-
<div id="doc">
<div>
Text in the first DIV.
</div>
<div id="DDD" class="secondClass">
Some text in the second DIV.
</div>
<div class="thirdClass">
Some text and <span id="SSS">element</span> in the third DIV.
</div>
<div class="fourthClass">
We can try <i>another elements</i>.
It will be much more <b>interesting</b>.
</div>
<div>
Text in the last DIV.
</div>
</div>
- JavaScript:
-
- var main = document.getElementById('doc');
- var output1 = main.childNodes.length;
- var output2 = main.childNodes[0].nodeType;
public static Number COMMENT_NODE
public static Number DOCUMENT_FRAGMENT_NODE
public static Number DOCUMENT_NODE
public static Number DOCUMENT_TYPE_NODE
public static Number ELEMENT_NODE
public static Number ENTITY_NODE
public static Number ENTITY_REFERENCE_NODE
public Node firstChild
- Example:
-
<div id="doc">
<div>
Text in the first DIV.
</div>
<div id="DDD" class="secondClass">
Some text in the second DIV.
</div>
<div class="thirdClass">
Some text and <span id="SSS">element</span> in the third DIV.
</div>
<div class="fourthClass">
We can try <i>another elements</i>.
It will be much more <b>interesting</b>.
</div>
<div>
Text in the last DIV.
</div>
</div>
- JavaScript:
-
- var main = document.getElementById('doc');
- var output = main.firstChild.nodeName;
public Node lastChild
- Example:
-
<div id="doc">
<div>
Text in the first DIV.
</div>
<div id="DDD" class="secondClass">
Some text in the second DIV.
</div>
<div class="thirdClass">
Some text and <span id="SSS">element</span> in the third DIV.
</div>
<div class="fourthClass">
We can try <i>another elements</i>.
It will be much more <b>interesting</b>.
</div>
<div>
Text in the last DIV.
</div>
</div>
- JavaScript:
-
- var main = document.getElementById('doc');
- var output = main.lastChild.nodeName;
public String localName
Document
interface, this is always null.
- Example:
-
<div id="doc" xmlns:svg="http://www.w3.org/2000/svg">
<div>
Text in the first DIV.
</div>
<svg:svg id="logo" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="60">
<svg:g style="fill:#3399cc; font-size:36pt; font-family:'dialog'; font-weight: bold">
<svg:a xlink:type="simple" xlink:href="http://www.zvon.org">
<svg:text x="50%" y="65%" text-anchor="middle">ZVON.org</svg:text>
</svg:a>
</svg:g>
</svg:svg>
<apply xmlns="http://www.w3.org/1998/Math/MathML">
<int/>
<bvar>
<ci> x </ci>
</bvar>
<interval>
<ci> a </ci>
<ci> b </ci>
</interval>
<apply>
<cos/>
<ci> x </ci>
</apply>
</apply>
<div>
Text in the last DIV.
</div>
</div>
- JavaScript:
-
- var elem = document.getElementsByTagName('int')[0];
- var output = elem.localName;
public String namespaceURI
Document
interface, this is always null.
- Example:
-
<div id="doc" xmlns:svg="http://www.w3.org/2000/svg">
<div>
Text in the first DIV.
</div>
<svg:svg id="logo" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="60">
<svg:g style="fill:#3399cc; font-size:36pt; font-family:'dialog'; font-weight: bold">
<svg:a xlink:type="simple" xlink:href="http://www.zvon.org">
<svg:text x="50%" y="65%" text-anchor="middle">ZVON.org</svg:text>
</svg:a>
</svg:g>
</svg:svg>
<apply xmlns="http://www.w3.org/1998/Math/MathML">
<int/>
<bvar>
<ci> x </ci>
</bvar>
<interval>
<ci> a </ci>
<ci> b </ci>
</interval>
<apply>
<cos/>
<ci> x </ci>
</apply>
</apply>
<div>
Text in the last DIV.
</div>
</div>
- JavaScript:
-
- var elem = document.getElementsByTagName('int')[0];
- var output = elem.namespaceURI;
public Node nextSibling
- Example:
-
<div id="doc">
<div>
Text in the first DIV.
</div>
<div id="DDD" class="secondClass">
Some text in the second DIV.
</div>
<div class="thirdClass">
Some text and <span id="SSS">element</span> in the third DIV.
</div>
<div class="fourthClass">
We can try <i>another elements</i>.
It will be much more <b>interesting</b>.
</div>
<div>
Text in the last DIV.
</div>
</div>
- JavaScript:
-
- var elem = document.getElementById('SSS');
- var output = elem.nextSibling.nodeValue;
public String nodeName
- Example:
-
<div id="doc">
<div>
Text in the first DIV.
</div>
<div id="DDD" class="secondClass">
Some text in the second DIV.
</div>
<div class="thirdClass">
Some text and <span id="SSS">element</span> in the third DIV.
</div>
<div class="fourthClass">
We can try <i>another elements</i>.
It will be much more <b>interesting</b>.
</div>
<div>
Text in the last DIV.
</div>
</div>
- JavaScript:
-
- var main = document.getElementById('doc');
- var output1 = main.nodeName;
- var output2 = document.getElementById('SSS').nodeName;
public Number nodeType
- Example:
-
<div id="doc">
<div>
Text in the first DIV.
</div>
<div id="DDD" class="secondClass">
Some text in the second DIV.
</div>
<div class="thirdClass">
Some text and <span id="SSS">element</span> in the third DIV.
</div>
<div class="fourthClass">
We can try <i>another elements</i>.
It will be much more <b>interesting</b>.
</div>
<div>
Text in the last DIV.
</div>
</div>
- JavaScript:
-
- var elem = document.getElementById('DDD');
- var output1 = elem.nodeType;
- var output2 = elem.firstChild.nodeType;
public String nodeValue
- Example:
-
<div id="doc">
<div>
Text in the first DIV.
</div>
<div id="DDD" class="secondClass">
Some text in the second DIV.
</div>
<div class="thirdClass">
Some text and <span id="SSS">element</span> in the third DIV.
</div>
<div class="fourthClass">
We can try <i>another elements</i>.
It will be much more <b>interesting</b>.
</div>
<div>
Text in the last DIV.
</div>
</div>
- JavaScript:
-
- var output = document.getElementById('DDD').firstChild.nodeValue;
-
public static Number NOTATION_NODE
public Document ownerDocument
Document
object associated with this node. This is also the Document
object
used to create new nodes. When this node is a Document
or a DocumentType
which
is not used with any Document
yet, this is null.
- Example:
-
<div id="doc">
<div>
Text in the first DIV.
</div>
<div id="DDD" class="secondClass">
Some text in the second DIV.
</div>
<div class="thirdClass">
Some text and <span id="SSS">element</span> in the third DIV.
</div>
<div class="fourthClass">
We can try <i>another elements</i>.
It will be much more <b>interesting</b>.
</div>
<div>
Text in the last DIV.
</div>
</div>
- JavaScript:
-
- var main = document.getElementById('doc');
- var output = main.ownerDocument.documentElement.nodeName;
public Node parentNode
- Example:
-
<div id="doc">
<div>
Text in the first DIV.
</div>
<div id="DDD" class="secondClass">
Some text in the second DIV.
</div>
<div class="thirdClass">
Some text and <span id="SSS">element</span> in the third DIV.
</div>
<div class="fourthClass">
We can try <i>another elements</i>.
It will be much more <b>interesting</b>.
</div>
<div>
Text in the last DIV.
</div>
</div>
- JavaScript:
-
- var elem = document.getElementById('SSS');
- var output = elem.nextSibling.nodeValue;
public String prefix
- Example:
-
<div id="doc" xmlns:svg="http://www.w3.org/2000/svg">
<div>
Text in the first DIV.
</div>
<svg:svg id="logo" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="60">
<svg:g style="fill:#3399cc; font-size:36pt; font-family:'dialog'; font-weight: bold">
<svg:a xlink:type="simple" xlink:href="http://www.zvon.org">
<svg:text x="50%" y="65%" text-anchor="middle">ZVON.org</svg:text>
</svg:a>
</svg:g>
</svg:svg>
<apply xmlns="http://www.w3.org/1998/Math/MathML">
<int/>
<bvar>
<ci> x </ci>
</bvar>
<interval>
<ci> a </ci>
<ci> b </ci>
</interval>
<apply>
<cos/>
<ci> x </ci>
</apply>
</apply>
<div>
Text in the last DIV.
</div>
</div>
- JavaScript:
-
- var main = document.getElementById('doc');
- var output1 = main.nodeName;
- var output2 = document.getElementById('SSS').nodeName;
public Node previousSibling
- Example:
-
<div id="doc">
<div>
Text in the first DIV.
</div>
<div id="DDD" class="secondClass">
Some text in the second DIV.
</div>
<div class="thirdClass">
Some text and <span id="SSS">element</span> in the third DIV.
</div>
<div class="fourthClass">
We can try <i>another elements</i>.
It will be much more <b>interesting</b>.
</div>
<div>
Text in the last DIV.
</div>
</div>
- JavaScript:
-
- var elem = document.getElementById('SSS');
- var output = elem.previousSibling.nodeValue;
public static Number PROCESSING_INSTRUCTION_NODE
public static Number TEXT_NODE
Method Detail |
---|
public Node appendChild(Node newChild)
- Example:
-
<div id="doc">
<div>
Text in the first DIV.
</div>
<div id="DDD" class="secondClass">
Some text in the second DIV.
</div>
<div class="thirdClass">
Some text and <span id="SSS">element</span> in the third DIV.
</div>
<div class="fourthClass">
We can try <i>another elements</i>.
It will be much more <b>interesting</b>.
</div>
<div>
Text in the last DIV.
</div>
</div>
- JavaScript:
-
- var main = document.getElementById('doc');
- main.appendChild(main.childNodes[1]);
- var output = main.lastChild.firstChild.nodeValue;
newChild | - | The node to add. If it is a DocumentFragment object, the entire contents of the document fragment are moved into the child list of this node. |
Node
- The node addedDOMException
HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow
children of the type of the newChild node, or if the node to append is one
of this node's ancestors.DOMException
WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document
than the one that created this node.DOMException
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.public Node cloneNode(Boolean deep)
Element
copies all attributes
and their values, including those generated by the XML processor to represent defaulted
attributes, but this method does not copy any text it contains unless it is a deep clone,
since the text is contained in a child Text
node. Cloning an Attribute directly,
as opposed to be cloned as part of an Element cloning operation, returns a specified attribute
(specified is true). Cloning any other type of node simply returns a copy of this node. EntityReference
clone are readonly. In addition, clones of unspecified Attr
nodes
are specified. And, cloning Document
, DocumentType
, Entity
, and
{&link Notation} nodes is implementation dependent.
- Example:
-
<div id="doc">
<div>
Text in the first DIV.
</div>
<div id="DDD" class="secondClass">
Some text in the second DIV.
</div>
<div class="thirdClass">
Some text and <span id="SSS">element</span> in the third DIV.
</div>
<div class="fourthClass">
We can try <i>another elements</i>.
It will be much more <b>interesting</b>.
</div>
<div>
Text in the last DIV.
</div>
</div>
- JavaScript:
-
- var main = document.getElementById('doc');
- var elem = main.childNodes[3];
- var returns = elem.cloneNode(true);
- var output = returns.firstChild.nodeValue;
deep | - | If true, recursively clone the subtree under the specified node; if false, clone only the node itself (and its attributes, if it is an Element). |
Node
- The duplicate nodepublic Boolean hasAttributes()
- Example:
-
<div id="doc">
<div>
Text in the first DIV.
</div>
<div id="DDD" class="secondClass">
Some text in the second DIV.
</div>
<div class="thirdClass">
Some text and <span id="SSS">element</span> in the third DIV.
</div>
<div class="fourthClass">
We can try <i>another elements</i>.
It will be much more <b>interesting</b>.
</div>
<div>
Text in the last DIV.
</div>
</div>
- JavaScript:
-
- var elem1 = document.getElementById('doc');
- var output1 = elem1.hasAttributes();
- var tmp = elem1.getElementsByTagName('div');
- var elem2 = tmp[tmp.length-1];
- var output2 = elem2.hasAttributes();
Boolean
- True if this node has any attributes, false otherwise.public Boolean hasChildNodes()
- Example:
-
<div id="doc">
<div>
Text in the first DIV.
</div>
<div id="DDD" class="secondClass">
Some text in the second DIV.
</div>
<div class="thirdClass">
Some text and <span id="SSS">element</span> in the third DIV.
</div>
<div class="fourthClass">
We can try <i>another elements</i>.
It will be much more <b>interesting</b>.
</div>
<div>
Text in the last DIV.
</div>
</div>
- JavaScript:
-
- var elem1 = document.getElementById('doc');
- var output1 = elem1.hasAttributes();
- var tmp = elem1.getElementsByTagName('div');
- var elem2 = tmp[tmp.length-1];
- var output2 = elem2.hasAttributes();
Boolean
- True if this node has any children, false otherwise.public Node insertBefore(Node newChild,
Node refChild)
DocumentFragment
object,
all of its children are inserted, in the same order, before refChild. If the newChild is already
in the tree, it is first removed.
- Example:
-
<div id="doc">
<div>
Text in the first DIV.
</div>
<div id="DDD" class="secondClass">
Some text in the second DIV.
</div>
<div class="thirdClass">
Some text and <span id="SSS">element</span> in the third DIV.
</div>
<div class="fourthClass">
We can try <i>another elements</i>.
It will be much more <b>interesting</b>.
</div>
<div>
Text in the last DIV.
</div>
</div>
- JavaScript:
-
- var main = document.getElementById('doc');
- main.insertBefore(document.getElementById('DDD'), main.firstChild);
- var output = main.firstChild.firstChild.nodeValue;
newChild | - | The node to insert. |
refChild | - | The reference node, i.e., the node before which the new node must be inserted. |
Node
- The node being inserted.DOMException
HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow
children of the type of the newChild node, or if the node to insert is one
of this node's ancestors.DOMException
WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document
than the one that created this node.DOMException
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly or if the
parent of the node being inserted is readonly.DOMException
NOT_FOUND_ERR: Raised if refChild is not a child of this node.public Boolean isSupported(String feature)
- Example:
-
<div id="doc">
<div>
Text in the first DIV.
</div>
<div id="DDD" class="secondClass">
Some text in the second DIV.
</div>
<div class="thirdClass">
Some text and <span id="SSS">element</span> in the third DIV.
</div>
<div class="fourthClass">
We can try <i>another elements</i>.
It will be much more <b>interesting</b>.
</div>
<div>
Text in the last DIV.
</div>
</div>
- JavaScript:
- var main = document.getElementById('doc');
- var output = main.isSupported('HTML', '1.0');
feature | - | The name of the feature to test. This is the same name which can be
passed to the method DOMImplementation.hasFeature(String, String) on
DOMImplementation . |
Boolean
- Returns true if the specified feature is supported on this node, false otherwise.public void normalize()
Text
nodes, i.e., there
are neither adjacent Text
nodes nor empty Text
nodes. This can be used to ensure
that the DOM view of a document is the same as if it were saved and re-loaded, and is useful when
operations (such as XPointer [XPointer] lookups) that depend on a particular document tree
structure are to be used. CDATASection
, the normalize operation alone
may not be sufficient, since XPointers do not differentiate between Text
nodes and
CDATASection
nodes.
- Example:
-
<div id="doc">></div>
- JavaScript:
- var main = document.getElementById('doc');
- var output1 = main.childNodes.length;
- var textNode1 = document.createTextNode('This is some text.');
- var textNode2 = document.createTextNode('This is another text.');
- main.appendChild(textNode1);
- main.appendChild(textNode2);
- var output2 = main.childNodes.length;
- main.normalize();
- var output3 = main.childNodes.length;
void
- nullpublic Node removeChild(Node oldChild)
- Example:
-
<div id="doc">
<div>
Text in the first DIV.
</div>
<div id="DDD" class="secondClass">
Some text in the second DIV.
</div>
<div class="thirdClass">
Some text and <span id="SSS">element</span> in the third DIV.
</div>
<div class="fourthClass">
We can try <i>another elements</i>.
It will be much more <b>interesting</b>.
</div>
<div>
Text in the last DIV.
</div>
</div>
- JavaScript:
- var elem = document.getElementById('SSS');
- var output1 = elem.firstChild.nodeValue;
- elem.removeChild(elem.firstChild);
- var output2 = elem.firstChild;
oldChild | - | The node being removed. |
Node
- The node removed.DOMException
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.DOMException
NOT_FOUND_ERR: Raised if oldChild is not a child of this node.public Node replaceChild(Node newNode,
Node oldNode)
DocumentFragment
object, oldChild is replaced by all of the
DocumentFragment
children, which are inserted in the same order. If the newChild is
already in the tree, it is first removed.
- Example:
-
<div id="doc">
<div>
Text in the first DIV.
</div>
<div id="DDD" class="secondClass">
Some text in the second DIV.
</div>
<div class="thirdClass">
Some text and <span id="SSS">element</span> in the third DIV.
</div>
<div class="fourthClass">
We can try <i>another elements</i>.
It will be much more <b>interesting</b>.
</div>
<div>
Text in the last DIV.
</div>
</div>
- JavaScript:
- var elem = document.getElementById('DDD');
- elem.replaceChild(document.getElementById('SSS').firstChild, elem.firstChild);
- var output = elem.firstChild.nodeValue;
newNode | - | The new node to put in the child list. |
oldNode | - | The node being replaced in the list. |
Node
- The node replaced.DOMException
HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow
children of the type of the newChild node, or if the node to put in is one
of this node's ancestors.DOMException
WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document
than the one that created this node.DOMException
NO_MODIFICATION_ALLOWED_ERR: Raised if this node or the parent of the new
node is readonly.DOMException
NOT_FOUND_ERR: Raised if oldChild is not a child of this node.
|
Oracle® Fusion Middleware Javascript API Reference for Oracle ADF Faces 12c (12.2.1.4.0) E81451-01 |
||||||||
PREV NEXT | FRAMES NO FRAMES Warning: private items are visible |