Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-release > by-pkgid > 1fce4ef419c004933c122e6231d6200b > files > 105

xml-commons-apis-manual-1.4.01-18.mga5.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
 Generated: Thu Nov 09 17:46:17 EST 2000 jfouffa.w3.org
 -->
<html lang='en' xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ECMAScript Language Binding</title>
<link rel='stylesheet' type='text/css' href='./spec.css' />
<link rel='stylesheet' type='text/css' href='W3C-REC.css' />
<link rel='next' href='acknowledgements.html' />
<link rel='contents' href='Overview.html#contents' />
<link rel='index' href='def-index.html' />
<link rel='previous' href='java-binding.html' />
</head>
<body>
<div class='navbar' align='center'><a accesskey='p'
href='java-binding.html'>previous</a> &nbsp; <a accesskey='n'
href='acknowledgements.html'>next</a> &nbsp; <a accesskey='c'
href='Overview.html#contents'>contents</a> &nbsp; <a accesskey='i'
href='def-index.html'>index</a> 

<hr title='Navigation area separator' />
</div>

<div class='noprint' style='text-align: right'>
<p style='font-family: monospace;font-size:small'>13 November,
2000</p>
</div>

<div class='div1'><a id="ecma-binding" name='ecma-binding'></a> 

<h1 id='ecma-binding-h1' class='adiv1'>Appendix C: ECMAScript
Language Binding</h1>

<p>This appendix contains the complete ECMAScript [<a
class='noxref' href='references.html#ECMAScript'>ECMAScript</a>]
binding for the Level 2 Document Object Model Traversal and Range
definitions. The definitions are divided into <a
href='#Traversal-ECMA'>Traversal</a>, and <a
href='#Range-ECMA'>Range</a>.</p>

<p><b>Note:</b> Exceptions handling is only supported by ECMAScript
implementation conformant with the Standard ECMA-262 3rd. Edition
([<a class='noxref'
href='references.html#ECMAScript'>ECMAScript</a>]).</p>

<div class='div2'><a id="Traversal-ECMA" name='Traversal-ECMA'></a>


<h2 id='Traversal-ECMA-h2' class='adiv2'>C.1: Document Object Model
Traversal</h2>

<div class='ecma-block'>
<dl>
<dt>Object <b>NodeIterator</b></dt>

<dd>
<dl>
<dt>The <b>NodeIterator</b> object has the following
properties:</dt>

<dd>
<dl>
<dt><b>root</b></dt>

<dd>This read-only property is a <b>Node</b> object.</dd>

<dt><b>whatToShow</b></dt>

<dd>This read-only property is of type <b>Number</b>.</dd>

<dt><b>filter</b></dt>

<dd>This read-only property is a <b>NodeFilter</b> object.</dd>

<dt><b>expandEntityReferences</b></dt>

<dd>This read-only property is of type <b>Boolean</b>.</dd>
</dl>
</dd>

<dt>The <b>NodeIterator</b> object has the following methods:</dt>

<dd>
<dl>
<dt><b>nextNode()</b></dt>

<dd>This method returns a <b>Node</b> object.<br />
This method can raise a <b>DOMException</b> object.</dd>

<dt><b>previousNode()</b></dt>

<dd>This method returns a <b>Node</b> object.<br />
This method can raise a <b>DOMException</b> object.</dd>

<dt><b>detach()</b></dt>

<dd>This method has no return value.</dd>
</dl>
</dd>
</dl>
</dd>

<dt>Prototype Object <b>NodeFilter</b></dt>

<dd>
<dl>
<dt>The <b>NodeFilter</b> class has the following constants:</dt>

<dd>
<dl>
<dt><b>NodeFilter.FILTER_ACCEPT</b></dt>

<dd>This constant is of type <b>short</b> and its value is
<b>1</b>.</dd>

<dt><b>NodeFilter.FILTER_REJECT</b></dt>

<dd>This constant is of type <b>short</b> and its value is
<b>2</b>.</dd>

<dt><b>NodeFilter.FILTER_SKIP</b></dt>

<dd>This constant is of type <b>short</b> and its value is
<b>3</b>.</dd>

<dt><b>NodeFilter.SHOW_ALL</b></dt>

<dd>This constant is of type <b>Number</b> and its value is
<b>0xFFFFFFFF</b>.</dd>

<dt><b>NodeFilter.SHOW_ELEMENT</b></dt>

<dd>This constant is of type <b>Number</b> and its value is
<b>0x00000001</b>.</dd>

<dt><b>NodeFilter.SHOW_ATTRIBUTE</b></dt>

<dd>This constant is of type <b>Number</b> and its value is
<b>0x00000002</b>.</dd>

<dt><b>NodeFilter.SHOW_TEXT</b></dt>

<dd>This constant is of type <b>Number</b> and its value is
<b>0x00000004</b>.</dd>

<dt><b>NodeFilter.SHOW_CDATA_SECTION</b></dt>

<dd>This constant is of type <b>Number</b> and its value is
<b>0x00000008</b>.</dd>

<dt><b>NodeFilter.SHOW_ENTITY_REFERENCE</b></dt>

<dd>This constant is of type <b>Number</b> and its value is
<b>0x00000010</b>.</dd>

<dt><b>NodeFilter.SHOW_ENTITY</b></dt>

<dd>This constant is of type <b>Number</b> and its value is
<b>0x00000020</b>.</dd>

<dt><b>NodeFilter.SHOW_PROCESSING_INSTRUCTION</b></dt>

<dd>This constant is of type <b>Number</b> and its value is
<b>0x00000040</b>.</dd>

<dt><b>NodeFilter.SHOW_COMMENT</b></dt>

<dd>This constant is of type <b>Number</b> and its value is
<b>0x00000080</b>.</dd>

<dt><b>NodeFilter.SHOW_DOCUMENT</b></dt>

<dd>This constant is of type <b>Number</b> and its value is
<b>0x00000100</b>.</dd>

<dt><b>NodeFilter.SHOW_DOCUMENT_TYPE</b></dt>

<dd>This constant is of type <b>Number</b> and its value is
<b>0x00000200</b>.</dd>

<dt><b>NodeFilter.SHOW_DOCUMENT_FRAGMENT</b></dt>

<dd>This constant is of type <b>Number</b> and its value is
<b>0x00000400</b>.</dd>

<dt><b>NodeFilter.SHOW_NOTATION</b></dt>

<dd>This constant is of type <b>Number</b> and its value is
<b>0x00000800</b>.</dd>
</dl>
</dd>
</dl>
</dd>

<dt>Object <b>NodeFilter</b></dt>

<dd>This is an ECMAScript function reference. This method returns a
<b>Number</b>. The parameter is a <b>Node</b> object.</dd>

<dt>Object <b>TreeWalker</b></dt>

<dd>
<dl>
<dt>The <b>TreeWalker</b> object has the following properties:</dt>

<dd>
<dl>
<dt><b>root</b></dt>

<dd>This read-only property is a <b>Node</b> object.</dd>

<dt><b>whatToShow</b></dt>

<dd>This read-only property is of type <b>Number</b>.</dd>

<dt><b>filter</b></dt>

<dd>This read-only property is a <b>NodeFilter</b> object.</dd>

<dt><b>expandEntityReferences</b></dt>

<dd>This read-only property is of type <b>Boolean</b>.</dd>

<dt><b>currentNode</b></dt>

<dd>This property is a <b>Node</b> object and can raise a
<b>DOMException</b> object on setting.</dd>
</dl>
</dd>

<dt>The <b>TreeWalker</b> object has the following methods:</dt>

<dd>
<dl>
<dt><b>parentNode()</b></dt>

<dd>This method returns a <b>Node</b> object.</dd>

<dt><b>firstChild()</b></dt>

<dd>This method returns a <b>Node</b> object.</dd>

<dt><b>lastChild()</b></dt>

<dd>This method returns a <b>Node</b> object.</dd>

<dt><b>previousSibling()</b></dt>

<dd>This method returns a <b>Node</b> object.</dd>

<dt><b>nextSibling()</b></dt>

<dd>This method returns a <b>Node</b> object.</dd>

<dt><b>previousNode()</b></dt>

<dd>This method returns a <b>Node</b> object.</dd>

<dt><b>nextNode()</b></dt>

<dd>This method returns a <b>Node</b> object.</dd>
</dl>
</dd>
</dl>
</dd>

<dt>Object <b>DocumentTraversal</b></dt>

<dd>
<dl>
<dt>The <b>DocumentTraversal</b> object has the following
methods:</dt>

<dd>
<dl>
<dt><b>createNodeIterator(root, whatToShow, filter,
entityReferenceExpansion)</b></dt>

<dd>This method returns a <b>NodeIterator</b> object.<br />
The <b>root</b> parameter is a <b>Node</b> object.<br />
The <b>whatToShow</b> parameter is of type <b>Number</b>.<br />
The <b>filter</b> parameter is a <b>NodeFilter</b> object.<br />
The <b>entityReferenceExpansion</b> parameter is of type
<b>Boolean</b>.<br />
This method can raise a <b>DOMException</b> object.</dd>

<dt><b>createTreeWalker(root, whatToShow, filter,
entityReferenceExpansion)</b></dt>

<dd>This method returns a <b>TreeWalker</b> object.<br />
The <b>root</b> parameter is a <b>Node</b> object.<br />
The <b>whatToShow</b> parameter is of type <b>Number</b>.<br />
The <b>filter</b> parameter is a <b>NodeFilter</b> object.<br />
The <b>entityReferenceExpansion</b> parameter is of type
<b>Boolean</b>.<br />
This method can raise a <b>DOMException</b> object.</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</div>

<!-- ecma-block -->
</div>

<!-- div2 Traversal-ECMA -->
<div class='div2'><a id="Range-ECMA" name='Range-ECMA'></a> 

<h2 id='Range-ECMA-h2' class='adiv2'>C.2: Document Object Model
Range</h2>

<div class='ecma-block'>
<dl>
<dt>Prototype Object <b>Range</b></dt>

<dd>
<dl>
<dt>The <b>Range</b> class has the following constants:</dt>

<dd>
<dl>
<dt><b>Range.START_TO_START</b></dt>

<dd>This constant is of type <b>Number</b> and its value is
<b>0</b>.</dd>

<dt><b>Range.START_TO_END</b></dt>

<dd>This constant is of type <b>Number</b> and its value is
<b>1</b>.</dd>

<dt><b>Range.END_TO_END</b></dt>

<dd>This constant is of type <b>Number</b> and its value is
<b>2</b>.</dd>

<dt><b>Range.END_TO_START</b></dt>

<dd>This constant is of type <b>Number</b> and its value is
<b>3</b>.</dd>
</dl>
</dd>
</dl>
</dd>

<dt>Object <b>Range</b></dt>

<dd>
<dl>
<dt>The <b>Range</b> object has the following properties:</dt>

<dd>
<dl>
<dt><b>startContainer</b></dt>

<dd>This read-only property is a <b>Node</b> object and can raise a
<b>DOMException</b> object on retrieval.</dd>

<dt><b>startOffset</b></dt>

<dd>This read-only property is a <b>long</b> object and can raise a
<b>DOMException</b> object on retrieval.</dd>

<dt><b>endContainer</b></dt>

<dd>This read-only property is a <b>Node</b> object and can raise a
<b>DOMException</b> object on retrieval.</dd>

<dt><b>endOffset</b></dt>

<dd>This read-only property is a <b>long</b> object and can raise a
<b>DOMException</b> object on retrieval.</dd>

<dt><b>collapsed</b></dt>

<dd>This read-only property is of type <b>Boolean</b> and can raise
a <b>DOMException</b> object on retrieval.</dd>

<dt><b>commonAncestorContainer</b></dt>

<dd>This read-only property is a <b>Node</b> object and can raise a
<b>DOMException</b> object on retrieval.</dd>
</dl>
</dd>

<dt>The <b>Range</b> object has the following methods:</dt>

<dd>
<dl>
<dt><b>setStart(refNode, offset)</b></dt>

<dd>This method has no return value.<br />
The <b>refNode</b> parameter is a <b>Node</b> object.<br />
The <b>offset</b> parameter is a <b>long</b> object.<br />
This method can raise a <b>RangeException</b> object or a
<b>DOMException</b> object.</dd>

<dt><b>setEnd(refNode, offset)</b></dt>

<dd>This method has no return value.<br />
The <b>refNode</b> parameter is a <b>Node</b> object.<br />
The <b>offset</b> parameter is a <b>long</b> object.<br />
This method can raise a <b>RangeException</b> object or a
<b>DOMException</b> object.</dd>

<dt><b>setStartBefore(refNode)</b></dt>

<dd>This method has no return value.<br />
The <b>refNode</b> parameter is a <b>Node</b> object.<br />
This method can raise a <b>RangeException</b> object or a
<b>DOMException</b> object.</dd>

<dt><b>setStartAfter(refNode)</b></dt>

<dd>This method has no return value.<br />
The <b>refNode</b> parameter is a <b>Node</b> object.<br />
This method can raise a <b>RangeException</b> object or a
<b>DOMException</b> object.</dd>

<dt><b>setEndBefore(refNode)</b></dt>

<dd>This method has no return value.<br />
The <b>refNode</b> parameter is a <b>Node</b> object.<br />
This method can raise a <b>RangeException</b> object or a
<b>DOMException</b> object.</dd>

<dt><b>setEndAfter(refNode)</b></dt>

<dd>This method has no return value.<br />
The <b>refNode</b> parameter is a <b>Node</b> object.<br />
This method can raise a <b>RangeException</b> object or a
<b>DOMException</b> object.</dd>

<dt><b>collapse(toStart)</b></dt>

<dd>This method has no return value.<br />
The <b>toStart</b> parameter is of type <b>Boolean</b>.<br />
This method can raise a <b>DOMException</b> object.</dd>

<dt><b>selectNode(refNode)</b></dt>

<dd>This method has no return value.<br />
The <b>refNode</b> parameter is a <b>Node</b> object.<br />
This method can raise a <b>RangeException</b> object or a
<b>DOMException</b> object.</dd>

<dt><b>selectNodeContents(refNode)</b></dt>

<dd>This method has no return value.<br />
The <b>refNode</b> parameter is a <b>Node</b> object.<br />
This method can raise a <b>RangeException</b> object or a
<b>DOMException</b> object.</dd>

<dt><b>compareBoundaryPoints(how, sourceRange)</b></dt>

<dd>This method returns a <b>short</b> object.<br />
The <b>how</b> parameter is of type <b>Number</b>.<br />
The <b>sourceRange</b> parameter is a <b>Range</b> object.<br />
This method can raise a <b>DOMException</b> object.</dd>

<dt><b>deleteContents()</b></dt>

<dd>This method has no return value.<br />
This method can raise a <b>DOMException</b> object.</dd>

<dt><b>extractContents()</b></dt>

<dd>This method returns a <b>DocumentFragment</b> object.<br />
This method can raise a <b>DOMException</b> object.</dd>

<dt><b>cloneContents()</b></dt>

<dd>This method returns a <b>DocumentFragment</b> object.<br />
This method can raise a <b>DOMException</b> object.</dd>

<dt><b>insertNode(newNode)</b></dt>

<dd>This method has no return value.<br />
The <b>newNode</b> parameter is a <b>Node</b> object.<br />
This method can raise a <b>DOMException</b> object or a
<b>RangeException</b> object.</dd>

<dt><b>surroundContents(newParent)</b></dt>

<dd>This method has no return value.<br />
The <b>newParent</b> parameter is a <b>Node</b> object.<br />
This method can raise a <b>DOMException</b> object or a
<b>RangeException</b> object.</dd>

<dt><b>cloneRange()</b></dt>

<dd>This method returns a <b>Range</b> object.<br />
This method can raise a <b>DOMException</b> object.</dd>

<dt><b>toString()</b></dt>

<dd>This method returns a <b>String</b>.<br />
This method can raise a <b>DOMException</b> object.</dd>

<dt><b>detach()</b></dt>

<dd>This method has no return value.<br />
This method can raise a <b>DOMException</b> object.</dd>
</dl>
</dd>
</dl>
</dd>

<dt>Object <b>DocumentRange</b></dt>

<dd>
<dl>
<dt>The <b>DocumentRange</b> object has the following methods:</dt>

<dd>
<dl>
<dt><b>createRange()</b></dt>

<dd>This method returns a <b>Range</b> object.</dd>
</dl>
</dd>
</dl>
</dd>

<dt>Prototype Object <b>RangeException</b></dt>

<dd>
<dl>
<dt>The <b>RangeException</b> class has the following
constants:</dt>

<dd>
<dl>
<dt><b>RangeException.BAD_BOUNDARYPOINTS_ERR</b></dt>

<dd>This constant is of type <b>Number</b> and its value is
<b>1</b>.</dd>

<dt><b>RangeException.INVALID_NODE_TYPE_ERR</b></dt>

<dd>This constant is of type <b>Number</b> and its value is
<b>2</b>.</dd>
</dl>
</dd>
</dl>
</dd>

<dt>Object <b>RangeException</b></dt>

<dd>
<dl>
<dt>The <b>RangeException</b> object has the following
properties:</dt>

<dd>
<dl>
<dt><b>code</b></dt>

<dd>This property is of type <b>Number</b>.</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
</div>

<!-- ecma-block -->
</div>

<!-- div2 Range-ECMA --></div>

<!-- div1 ecma-binding -->
<div class='navbar' align='center'>
<hr title='Navigation area separator' />
<a accesskey='p' href='java-binding.html'>previous</a> &nbsp; <a
accesskey='n' href='acknowledgements.html'>next</a> &nbsp; <a
accesskey='c' href='Overview.html#contents'>contents</a> &nbsp; <a
accesskey='i' href='def-index.html'>index</a></div>
</body>
</html>