W3C 勧告

Element Traversal 仕様 日本語訳

この文書は、W3C が作成し、勧告として公開された Element Traversal Specification を日本語に翻訳したものです。

このページには(画像も含め)スタイルシート等の外部依存のリソースは利用されていません。ページのみをそのままローカルに保存しても閲覧には支障ありません。

この文書は二次著作物にあたり、著作権は原著作物に帰するものです。二次著作物としての著作権者にあたる翻訳者はこの日本語訳の利用, 複製, 頒布について制限は設けません。

翻訳開始日:2010-04-22, 最終更新日: 2011-12-15

誤訳その他ご指摘/ご意見は連絡先まで。

W3C

要素トラバーサル( Element Traversal )仕様

W3C 勧告 2008年12月22日

このバージョン:
http://www.w3.org/TR/2008/REC-ElementTraversal-20081222/
最新バージョン:
http://www.w3.org/TR/ElementTraversal/
前のバージョン:
http://www.w3.org/TR/2008/PR-ElementTraversal-20081117/
編集:
Doug Schepers (W3C, formerly Vectoreal) <schepers@w3.org>
Robin Berjon (formerly Expway) <robin@berjon.com>, until 2006

この文書の正式な訂正も含み得る エラータ も参照願います。 Please refer to the errata for this document, which may include some normative corrections.

各国語への 翻訳 もご覧下さい。 See also translations.


要約

この仕様はスクリプトによる DOM ツリー内の、テキストノード他すべてのノードを除外した要素のナビゲーションを可能にする ElementTraversal インターフェースを定めます。 また、要素内の子要素の総数を公開する属性も与えます。 その意図は小さな実装の負担で既存の DOM ナビゲーション インターフェースの代替になる簡便な方法を提供する所にあります。 This specification defines the ElementTraversal interface, which allows script navigation of the elements of a DOM tree, excluding all other nodes in the DOM, such as text nodes. It also provides an attribute to expose the number of child elements of an element. It is intended to provide a more convenient alternative to existing DOM navigation interfaces, with a low implementation footprint.

この文書の位置付け

この節では公開された時点におけるこの文書の位置付けについて述べます。 他の文書がこの文書にとってかわる可能性があります。 現在の W3C 公開文書の一覧およびこの技術についての最新レポートは http://www.w3.org/TR/ にある W3C technical reports index で見る事ができます。 This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.

これは 2008 年 12 月 22 付けの Element Traversal 仕様勧告です。 This is the 22 December 2008 Recommendation of the Element Traversal specification.

この文書は W3C メンバ, ソフトウェア開発者達, 他の W3C グループや関心を持つ団体から吟味され、ディレクターにより W3C 勧告として保証されたものです。 これは安定した文書であり、参照資料として利用したり、他の文書に引用することができます。 勧告の発行における W3C の役割は、仕様に対する注目を集め、広範囲への普及を促進する所にあります。 これはウェブの相互運用性と機能性を向上させるものです。 This document has been reviewed by W3C Members, by software developers, and by other W3C groups and interested parties, and is endorsed by the Director as a W3C Recommendation. It is a stable document and may be used as reference material or cited from another document. W3C's role in making the Recommendation is to draw attention to the specification and to promote its widespread deployment. This enhances the functionality and interoperability of the Web.

Web Applications (WebApps) Working Group は、現時点におけるこの仕様に対する(すべてのテストに合格した結果を伴った)実装レベルのサポート状況を示すため、 テストスイート実装報告書 を作成しました。 The Web Applications (WebApps) Working Group has produced a test suite and implementation report to indicate the current level of implementation support for this specification, with passing results for all tests. There have been no changes since Proposed Recommendation.

この仕様に関する質問やコメントは WebApps WG deliverables に関する議論を扱う公開メーリングリスト: public-webapps@w3.org 宛てに送って下さい。 このメーリングリストは公開状態でアーカイブ保存されています。 このリストに加入し最初の投稿を行った時点でそのことに同意したものとみなされます。 このメーリングリストに加入されたい方は件名に "subscribe" と記したメールを public-webapps-request@w3.org 宛てまで送って下さい。 Please send questions and comments regarding this specification to public-webapps@w3.org, the public email list for issues related to WebApps WG deliverables. This list is publicly archived, and acceptance of this archiving policy is requested automatically upon first post. To subscribe to this list send an email to public-webapps-request@w3.org with the word "subscribe" in the subject line.

この文書は W3C Process に沿う手順を踏んで Rich Web Clients Activity の一部として Web Applications (WebApps) Working Group により作成されました。 This document has been produced by the Web Applications (WebApps) Working Group as part of the W3C Rich Web Clients Activity, following the procedures set out for the W3C Process.

ElementTraversal インターフェースは元々は SVG Tiny 1.2 仕様 の一部として SVG 名前空間に含まれるものとして発行されました。 SVG, CDF, JCP, その他のグループからの要望により、 WebAPI WG へ移管され、汎用的なファシリティとして DOM と DOM 名前空間に移されることになりました。 WebAPI WG からの交付の責務が WebApps WG に移管されることになった時点で再び移行されることになりました。 The ElementTraversal interface was originally published as part of the SVG Tiny 1.2 specification in the SVG namespace. At the request of the SVG, CDF, JCP, and other groups, it was transferred to the WebAPI WG, and migrated to DOM and DOM namespace as a generic facility. It was transferred again when the WebApps WG took responsibility for the deliverables of the WebAPI WG.

この文書は 5 February 2004 W3C Patent Policy に従事しているグループにより作成されています。 W3C はグループの成果物に関連して すべての特許開示の公開リスト を作成し維持管理しています。 そのページには特許公開の手引きも含まれます。 特許に関する実際的知識を持ち、そこに Essential Claim(s) が含まれていると主張する者は section 6 of the W3C Patent Policy に従って情報を公開しなければなりません。 This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.

目次

1. 導入

この節は参考情報である。 This section is informative.

DOM Level 1 Node インターフェースでは 11 種類のノードが定められているが、一般的には、もっぱら nodeType 1 のノード、すなわち Element (要素)ノードに対してのみの処理が望まれることが最も多い。 他の種のノード型には Document (文書)ノードや Text (テキスト)ノードも含まれ、空白や改行までもそれらに含まれる。 DOM 1 ノード traversal においてはこれらすべてのノード型が含まれ、文書作成者にとってはしばしば混乱の元にもなり、期待される Element ノードインターフェースの利用を確立するための余分な手間もかかる。 これは余分なパフォーマンス上の足枷ももたらす。 The DOM Level 1 Node interface defines 11 node types, but most commonly authors wish to operate solely on nodeType 1, the Element node. Other node types include the Document element and Text nodes, which include whitespace and line breaks. DOM 1 node traversal includes all of these node types, which is often a source of confusion for authors and which requires an extra step for authors to confirm that the expected Element node interfaces are available. This introduces an additional performance constraint.

ElementTraversal は文書作成者によるナビゲーションを Element ノードのみに限定するインターフェースになる。 それは要素からその最初の子要素, 最後の子要素, 次または前の同胞要素へのナビゲーションを保証する。 実装においては要素ノードのみの公開になるので、制約が厳しい機器においては DOM 表現に要するメモリ消費と計算量の最適化が可能になる。 【同胞 - sibling :同じ親ノード下のノードを指す。「兄弟」と訳されることが多いが、当訳では原語の男女区別の無い兄弟姉妹の意味に即して「同胞」と訳す。】 ElementTraversal is an interface which allows the author to restrict navigation to Element nodes. It permits navigation from an element to its first element child, its last element child, and to its next or previous element siblings. Because the implementation exposes only the element nodes, the memory and computational footprint of the DOM representation can be optimized for constrained devices.

DOM Level 1 Node インターフェースはノードのすべての子ノードの生きたリストを表す childNodes 属性も定めている。 childNodes リストには length 属性があり、子ノード巡回の前に行う, あるいはその代わりになる処理に有用な、すべての nodeType に渡る子ノードの総数が公開される。 ElementTraversal インターフェースにもその種の処理にしばしば望まれる類似の属性 childElementCount があり、 Element ノードのみの個数を与える。 The DOM Level 1 Node interface also defines the childNodes attribute, which is a live list of all child nodes of the node; the childNodes list has a length attribute to expose the total number of child nodes of all nodeTypes, useful for preprocessing operations and calculations before, or instead of, looping through the child nodes. The ElementTraversal interface has a similar attribute, childElementCount, that reports only the number of Element nodes, which is often what is desired for such operations.

1.1. この仕様が含まないもの

この仕様は Element オブジェクトで利用できる属性, メソッド, その他のインターフェースの完全なリストを含むものではない。 それらのインターフェースは他の仕様、特に DOM Core 仕様で見られる。 This specification does not include the complete list of attributes, methods, and other interfaces available on the Element object. Additional interfaces are found in other specifications, notably the DOM Core specifications.

1.2. 適合性

この節は規定である。 This section is normative.

この文書においてキーワード "〜しなければならない" ( MUST ), "〜してはならない"( MUST NOT ), "要求される"( REQUIRED ), "〜するものとする( SHALL )", "〜しないものとする( SHALL NOT )", "〜すべきである"( SHOULD ), "〜すべきではない( SHOULD NOT )", "推奨される( RECOMMENDED )", "〜してもよい"( MAY ), "オプション( OPTIONAL )" は RFC 2119 [RFC2119] に述べられる意味で解釈するものとする。 読み易さのため、この文書ではこれらの単語の大文字表記は利用しない。 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119]. For purposes of readability, these terms are not necessarily used in a case-sensitive manner in this document.

可読性のため、適合性の要件は、要素, 属性, メソッド, インターフェース, プロパティ, 機能に対する要求として記述されることがある。 すべての場合において、これらは実装に対する適合性の要求事項になる。 この仕様に適合する実装はその言語バインディングの範囲において、これらの語の使用により特定されるすべての要件を満たすこととする。 Sometimes, for readability, conformance requirements are phrased as requirements on elements, attributes, methods, interfaces, properties or functions. In all cases these are conformance requirements on implementations. A conforming implementation of this specification meets all requirements identified by the use of these terms, within the scope of its language bindings.

2. ElementTraversal インターフェース

この節は規定である。 This section is normative.

ElementTraversal (要素トラバーサル)インターフェースは、文書作成者にとり、文書内の要素間ナビゲーションを容易にするための読み出し専用の属性のセットである。 Element Traversal に適合する実装においては、 Element を実装するすべてのオブジェクトが ElementTraversal インターフェースも実装しなければならない。 4つの属性 firstElementChild, lastElementChild, previousElementSibling, nextElementSibling のそれぞれは、現在の要素から相対的に定まる他の要素(もし存在するなら)への生きた参照を与える。 5番目の属性 childElementCount は、ナビゲーション前の前処理に有用な要素の子要素の総数を公開する。 適合するユーザエージェントはこの5属性すべてを実装しなければならない。 ユーザエージェントは他の仕様の類似のインターフェースを実装しても良いが、ユーザエージェントが最小限の実装を目指して設計される場合、それらの実装はこの仕様の適合性には要求されない。 The ElementTraversal interface is a set of read-only attributes which allow an author to easily navigate between elements in a document. In conforming implementations of Element Traversal, all objects that implement Element must also implement the ElementTraversal interface. Four of the attributes, firstElementChild, lastElementChild, previousElementSibling, and nextElementSibling, each provide a live reference to another element with the defined relationship to the current element, if the related element exists. The fifth attribute, childElementCount, exposes the number of child elements of an element, for preprocessing before navigation. A conforming User Agent must implement all five attributes. A User Agent may implement similar interfaces in other specifications, but such implementation is not required for conformance to this specification, if the User Agent is designed for a minimal code footprint.

このインターフェースはすべての Element に対し、それらが属する名前空間に関わらず実装されなければならない。 EntityReference (実体参照)ノードは Element Traversal の仕組みからは不可視になる。 ツリーの巡回において EntityReference ノードに遭遇した場合、呼び出し元にはその情報が返されることなく子孫としてツリーに組み込まれ、実体参照ノードが見つかった場所に子ノードが存在していたかの様に処理することとする。 ナビゲーションにおいて名前空間は無視されなければならない。 例えば HTML 名前空間の要素に SVG 名前空間の要素が後続していても、その HTML 要素の nextElementSibling 属性は SVG 要素を返すことになる。 This interface must be implemented on all Elements, regardless of their namespace. EntityReference nodes are not visible to the Element Traversal mechanism; if the tree-walker encounters an EntityReference node, it descends into it without informing the caller, and processes any children as if they had been present at the place where the entity node was found. Navigation must be irrespective of namespace, e.g. if an element in the HTML namespace is followed by element in the SVG namespace, the nextElementSibling attribute on the HTML element will return the SVG element.

2.1. firstElementChild

要素のこの属性へのアクセスにおいては、要素の最初の nodeType 1 の子ノードへの参照が Element オブジェクトとして返されなければならない。 この属性にアクセスされた要素に子ノードが存在しない, あるいは要素ノードになる子ノードが存在しない場合、この属性は null を返さなければならない。 Accessing this attribute of an element must return a reference to the first child node of that element which is of nodeType 1, as an Element object. If the element on which this attribute is accessed does not have any child nodes, or if none of those child nodes are element nodes, then this attribute must return null.

2.2. lastElementChild

要素のこの属性へのアクセスにおいては、要素の最後の nodeType 1 の子ノードへの参照が Element オブジェクトとして返されなければならない。 この属性にアクセスされた要素に子ノードが存在しない, あるいは要素ノードになる子ノードが存在しない場合、この属性は null を返さなければならない。 Accessing this attribute of an element must return a reference to the last child node of that element which is of nodeType 1, as an Element object. If the element on which this attribute is accessed does not have any child nodes, or if none of those child nodes are element nodes, then this attribute must return null.

2.3. previousElementSibling

要素のこの属性へのアクセスにおいては、要素より前に位置する同胞ノードのうち、要素に最も近い nodeType 1 のノードへの参照が Element オブジェクトとして返されなければならない。 この属性にアクセスされた要素に対し、より前に位置する同胞ノードが存在しない, あるいはそれらの同胞ノードに要素ノードになるものが存在しない場合、この属性は null を返さなければならない。 Accessing this attribute of an element must return a reference to the sibling node of that element which most immediately precedes that element in document order, and which is of nodeType 1, as an Element object. If the element on which this attribute is accessed does not have any preceding sibling nodes, or if none of those preceding sibling nodes are element nodes, then this attribute must return null.

2.4. nextElementSibling

要素のこの属性へのアクセスにおいては、要素より後にある同胞ノードのうち、要素に最も近い nodeType 1 のノードへの参照が Element オブジェクトとして返されなければならない。 この属性にアクセスされた要素に対し、より後に同胞ノードが存在しない, あるいはそれらの同胞ノードに要素ノードになるものが存在しない場合、この属性は null を返さなければならない。 Accessing this attribute of an element must return a reference to the sibling node of that element which most immediately follows that element in document order, and which is of nodeType 1, as an Element object. If the element on which this attribute is accessed does not have any following sibling nodes, or if none of those following sibling nodes are element nodes, then this attribute must return null.

2.5. childElementCount

要素のこの属性へのアクセスにおいては、要素が現在持つ nodeType 1 の子ノードの総数が返されなければならない。 実装はこの数を保存しておいても, この属性にアクセスされた時点で算出してもよいが、この数は常にこの属性がアクセスされた時点における子要素ノードの総数を表現しなければならない。 数え上げの対象になるノードは直接の子ノードのみでなければならない。 例えば、この属性にアクセスされた要素の子ノードの子ノードになっている要素は対象外になる。 この属性にアクセスされた要素に子ノードが存在しない, あるいはどの子ノードも要素ノードでない場合、この属性は 0 を返さなければならない。 Accessing this attribute of an element must return the current number of child nodes of that element which are of nodeType 1. An implementation may store this number, or it may calculate it upon accessing this attribute, but the number must always represent the number of child element nodes at the time the attribute is accessed. Only immediate child nodes must be counted, e.g. elements which are child nodes of one of the child nodes of the element on which the attribute is accessed are not included in this count. If the element on which this attribute is accessed does not have any child nodes, or if none of those child nodes are element nodes, then this attribute must return 0.

3. 用例

この節は参考情報である。 This section is informative.

この節では ECMAScript [ECMA262] による Element Traversal の用例をいくつか示す。 This section illustrates several ECMAScript [ECMA262] examples using Element Traversal.

3.1. previousElementSibling の例

この例では previousElementSibling 属性の効用を示す。 次のコードは要素をパラメタにとり、その親の中における要素の文書順による位置を返す: This example demonstrates the utility of the previousElementSibling attribute. The following code takes an element as a parameter, and returns the element's position in document order within its parent:

function findPosition( el ) {
   var pos = 0;

   // 子要素を逆順に巡回
   while ( null != el ) {
      // 前の同胞要素ノードへ移動
      el = el.previousElementSibling;
      pos++;
   }
   
   return pos;
}

3.2. 値の事前算出と要素の巡回を行う例

この例では childElementCount 属性の効用を示す。 次のコードは要素をパラメタにとり、利用できる領域の広さに応じて子要素を等間隔に配置する: This example demonstrates the utility of the childElementCount attribute. The following code takes an element as a parameter, and places each of its children equidistantly according to the available space:

function spaceChildren( el ) {
   // 子要素ノードの総数を取得
   var elCount = el.childElementCount;
   
   var eachWidth = window.innerWidth / (elCount + 1);

   // 最初の子要素を取得
   var childEl = el.firstElementChild;

   // 初期位置を設定
   var nextPos = eachWidth/2;
   
   // 子要素を1つずつ順に巡回
   while ( childEl ) {
      // 子を配置
      childEl.style.setProperty( 'position', 'absolute', '' );
      childEl.style.setProperty( 'left', nextPos + 'px', '' );
      childEl.style.setProperty( 'width', eachWidth + 'px', '' );
      
      // 位置を width だけ増分
      nextPos += eachWidth;
      
      // 次の子要素へ移動
      childEl = childEl.nextElementSibling;
   }
}

3.3. 他の DOM インターフェースとの比較例

この例では ElementTraversal と他の DOM インターフェースとの対照を示す。 次の SVG 文書片に対し、その下のスクリプトは DOM ツリーに対する異なる巡回の仕方を示す: This example contrasts ElementTraversal with other DOM interfaces. The following script shows different methods of iterating through a DOM tree, given the following SVG fragment:

<g id='shapeGroup'>

   <rect id='rect1' x='5' y='5' width='310' height='220' rx='15' ry='15' fill='skyblue'/>
   <rect id='rect2' x='15' y='15' width='210' height='180' rx='15' ry='15' fill='cornflowerblue'/>

   <ellipse id='ellipse1' cx='90' cy='70' rx='50' ry='30' fill='yellow' stroke='orange'/>

   <path id='path1' stroke-width='15' stroke='orange' fill='none' stroke-linecap='round' 
      d='M25,150 C180,180 290,0 400,140 S420,100 460,90'/>  
   <text id='text1' x='0' y='0' font-size='35' fill='yellow' stroke='orange'
      stroke-width='2' stroke-linejoin='round' font-weight='bold'>
      <textPath id='textPath1' xlink:href="#path1">when life gives you lemons...</textPath></text>

</g>
function walkTest( el ) {
   // 子ノードの総数を取得
   var nodeCount = el.childNodes.length;

   // 最初の子ノードを取得
   var firstNode = el.firstChild;

   // 最初の子要素ノードを取得
   var childEl = el.firstElementChild;

   // 子要素ノードを1つずつ巡回
   while ( childEl ) {
      // 何か有用なことを行う…

      // 次の子要素ノードへ移動
      childEl = childEl.nextElementSibling;
   }
}

ここで el'id'"shapeGroup"'g' 要素であれば nodeCount の値は 11 になる。 firstNodeText ノード( nodeType3 )になり、 childEl に最初に代入される値、すなわち 'id'"rect1"Element ノード( nodeType1 )とは等しくならない。 while ループは同胞 Element ノードを "rect2", "ellipse1", "path1", "text1" の順にあと4周反復されることになる。 "text1" には次の同胞ノードは存在しても次の同胞要素は存在しないので childEl の最終的な値は null になる。 Where el is the 'g' element with the 'id' "shapeGroup", nodeCount will have the value 11. firstNode will be a Text node (nodeType of 3), and is not equivalent to the first assigned value of childEl, which is an Element node (nodeType of 1) with the 'id' "rect1". The while loop will cycle 4 more times, iterating through the sibling Element nodes, respectively "rect2", "ellipse1", "path1", and "text1". The last value of childEl will be null, as "text1" does not have a next element sibling, though it does have a next node sibling.

SVG 'text' 要素は Text ノードではないことに注意。 また、 'text' 要素の SVG 'textPath' 子要素は childEl の同胞ノードではないので反復には含まれないことに注意。 Note that an SVG 'text' element is not the same as a Text node. Note also that the SVG 'textPath' child element of the 'text' element is not included in the iteration, as it is not a sibling of childEl.

4. 他の DOM 仕様との関係

この節は参考情報である。 This section is informative.

4.1. DOM Level 1 Core

この仕様は DOM 1 Core の DOM ナビゲーション属性に類似しつつ、他のノード型を含まずに要素ノードのみの処理を行う機能を備えるインターフェースを提供する。 最も類似する DOM 1 Core 属性は firstChild, lastChild, previousSibling, nextSibling, nodeList.length になる。 This specification provides an interface that has functional similarity to the DOM navigation attributes of DOM 1 Core, but operates only on element nodes, not other node types. The most comparable DOM 1 Core attributes are firstChild, lastChild, previousSibling, nextSibling, and nodeList.length.

4.2. DOM Level 2 Traversal & Range

DOM Level 2 Traversal & Range は包括的な文書ナビゲーション仕様であるが、 Element Traversal よりも機器と実装のリソースを要求する。 Element Traversal は DOM 2 Traversal の機能の最適化されたサブセットからなるので、両方を実装するユーザエージェントはそのような形で Traversal の機能を派生利用してもよい。 Document Object Model Level 2 Traversal & Range is a comprehensive document navigation specification, but may require more device and implementor resources than Element Traversal. As Element Traversal consists of an optimized subset of the functionality of DOM 2 Traversal, a user agent that implements both may do so in a way that leverages the functionality of Traversal.

4.3. DOM Level 3 Core

これは DOM 3 Core に対する増補となる仕様になる。 This is a supplementary specification to DOM 3 Core.

5. 保安上の考慮事項

この節は参考情報である。 This section is informative.

ElementTraversal インターフェースの実装と運用に関しては、これまでの所、保安上考慮すべき事項は見つかっていない。 将来何らかの考慮すべき事項が生じた場合、この節も改訂されるものとする。 There are no known security considerations involved in the implementation or use of the ElementTraversal interface. This section shall be revised if future security considerations are discovered.

A. IDL 定義

IDL 定義
interface ElementTraversal
{
   readonly attribute Element        firstElementChild;
   readonly attribute Element        lastElementChild;
   readonly attribute Element        previousElementSibling;
   readonly attribute Element        nextElementSibling;
   readonly attribute unsigned long  childElementCount;
};
定数は定義されない
属性
firstElementChild
この要素の最初の子要素ノードを返す。 子要素ノードが存在しない場合は null を返す。 Returns the first child element node of this element. null if this element has no child elements.
lastElementChild
この要素の最後の子要素ノードを返す。 子要素ノードが存在しない場合は null を返す。 Returns the last child element node of this element. null if this element has no child elements.
previousElementSibling
この要素の前の同胞要素ノードを返す。 文書ツリー内でこの要素より前に位置する同胞要素ノードが存在しなければ null を返す。 Returns the previous sibling element node of this element. null if this element has no element sibling nodes that come before this one in the document tree.
nextElementSibling
この要素の次の同胞要素ノードを返す。 文書ツリー内でこの要素より後に位置する同胞要素ノードが存在しなければ null を返す。 Returns the next sibling element node of this element. null if this element has no element sibling nodes that come after this one in the document tree.
childElementCount
この要素の子になっている要素ノードの現在の総数を返す。 この要素が nodeType 1 の子ノードを持っていない場合は 0 を返す。 Returns the current number of element nodes that are children of this element. 0 if this element has no child nodes that are of nodeType 1.
メソッドは定義されない

B. ECMAScript 言語バインディング

Object Element
ElementTraversal を実装するユーザエージェントにおいては、 Element は、他の DOM 仕様で定められる NodeElement のすべてのプロパティとメソッドを持ち、加えて、次のプロパティを持つ: In a User Agent which implements the ElementTraversal interface, Element has all the properties and methods of Node and Element as defined in other DOM specifications, and in addition has the following properties:
firstElementChild
この読み出し専用のプロパティの型は Element This read-only property is of type Element.
lastElementChild
この読み出し専用のプロパティの型は Element This read-only property is of type Element.
previousElementSibling
この読み出し専用のプロパティの型は Element This read-only property is of type Element.
nextElementSibling
この読み出し専用のプロパティの型は Element This read-only property is of type Element.
childElementCount
この読み出し専用のプロパティの型は Number This read-only property is of type Number.

C. Java 言語バインディング

org/w3c/dom/ElementTraversal.java:

package org.w3c.dom;

public interface ElementTraversal 
{
    Element getFirstElementChild();

    Element getLastElementChild();

    Element getPreviousElementSibling();

    Element getNextElementSibling();

    int getChildElementCount();
}

D. 変更履歴

草案の過程で例に対する種々の編集上の訂正と変更が施された。 Various editorial changes and corrections and modifications to the examples were made from draft to draft.

この仕様に記された理由により属性 childElementCount が元々の提案に追加された。 The attribute childElementCount was supplementary to the original proposal, for reasons stated in this specification.

E. 参照文献

規範とする文献

[RFC2119]
Key words for use in RFCs to indicate Requirement Levels, S. Bradner, March 1997. The specification for how to use English as if it were a technical language to indicate normative requirements.
「要求の程度を示すために RFC 中で使用されるキーワード」 技術的な言語として規範的要件を示すための英語の語法の仕様。
[DOM1Core]
Document Object Model - Level 1 Core, V. Apparao, S. Byrne, M. Champion, S. Isaacs, I. Jacobs, A. Le Hors, G. Nicol, J. Robie, R. Sutor, C. Wilson, L. Wood, Editors. World Wide Web Consortium, 1 October 1998. A standard set of objects for representing HTML and XML documents, a standard model of how these objects can be combined, and a standard interface for accessing and manipulating them.
「文書オブジェクトモデル (DOM) Level 1 Core」 HTML と XML 文書を表現するためのオブジェクトの標準的なセット, これらのオブジェクトがどのように組み合わされるかのモデル, これらに対するアクセスと操作を行うための標準的なインターフェース。
[ECMA262]
Standard ECMA-262, 3rd edition. ECMA International, December 1999. The specification for the ECMAScript language, of which JavaScript is a dialect.
「ECMA-262, 第 3 版」 JavaScript を1方言とする ECMAScript 言語の仕様。 日本語訳

文献(参考)

[SVGD]
The SVG Micro DOM (uDOM), O. Andersson, R. Berjon, E. Dahlström, A. Emmons, J. Ferraiolo, V. Hardy, S. Hayman, D. Jackson, C. Lilley, A. Neumann, C. Northway, A. Quint, N. Ramani, D. Schepers, A. Shellshear, Editors. World Wide Web Consortium, 10 August 2006. The proposed ElementTraversal interface in SVG.
「SVG Micro DOM (uDOM)」 SVG により提案された ElementTraversal インターフェース。
[DOM2TR]
Document Object Model (DOM) Level 2 Traversal and Range Specification, J. Kesselman, J. Robie, M. Champion, P. Sharpe, V. Apparao, L. Wood, Editors. World Wide Web Consortium, 13 November 2000. A set of platform- and language-neutral interfaces that allow programs and scripts to dynamically traverse and identify a range of content in a document.
「文書オブジェクトモデル (DOM) Level 2 Traversal and Range 仕様」 プログラムとスクリプトが文書内容の範囲の指定と巡回を動的に行えるようにするためのプラットフォーム中立かつ言語中立なインターフェースのセット。 【日本語訳:Travesal, Range
[DOM3Core]
Document Object Model (DOM) Level 3 Core Specification, A. Le Hors, P. Le Hégaret, L. Wood, G. Nicol, J. Robie, M. Champion, S. Byrne, Editors. World Wide Web Consortium, 07 April 2004. A platform- and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure and style of documents.
「文書オブジェクトモデル (DOM) Level 3 Core 仕様」 プログラムとスクリプトが文書の内容, 構造, スタイルに対するアクセスと更新を動的に行えるようにするためのプラットフォーム中立かつ言語中立なインターフェースのセット。 日本語訳

F. 謝辞

編集者は、この仕様に寄与された次の方々に謝意を表します: David Andersson, Robin Berjon, Jean-Yves Bitterlich, Sergiu Dumitriu, Daniel Glazman, Bjoern Hoehrmann, Kurosawa Takeshi, Chris Lilley, Charles McCathieNevile, Cameron McCormack, Simon Pieters, Nandini Ramani, Jonas Sicking, Andrew Sledd, Josh Soref, Anne van Kesteren, Boris Zbarsky, Mohamed Zergaoui
また、この仕様の元々の下地となった草案 [SVGD] を作成された SVG WG にも謝意を表します。 The editor would like to thank the following people for contributing to this specification: David Andersson, Robin Berjon, Jean-Yves Bitterlich, Sergiu Dumitriu, Daniel Glazman, Bjoern Hoehrmann, Kurosawa Takeshi, Chris Lilley, Charles McCathieNevile, Cameron McCormack, Simon Pieters, Nandini Ramani, Jonas Sicking, Andrew Sledd, Josh Soref, Anne van Kesteren, Boris Zbarsky, and Mohamed Zergaoui. The editor would additionally like to thank the SVG WG for producing the draft [SVGD] on which this was initially based.

Public documents on the W3C site are provided by the copyright holders under the following license.

License

By using and/or copying this document, or the W3C document from which this statement is linked, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions:

Permission to copy, and distribute the contents of this document, or the W3C document from which this statement is linked, in any medium for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the document, or portions thereof, that you use:

When space permits, inclusion of the full text of this NOTICE should be provided. We request that authorship attribution be provided in any software, documents, or other items or products that you create pursuant to the implementation of the contents of this document, or any portion thereof.

No right to create modifications or derivatives of W3C documents is granted pursuant to this license. However, if additional requirements (documented in the Copyright FAQ) are satisfied, the right to create modifications or derivatives is sometimes granted by the W3C to individuals complying with those requirements.

Disclaimers

THIS DOCUMENT IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF THE DOCUMENT ARE SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.

COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE DOCUMENT OR THE PERFORMANCE OR IMPLEMENTATION OF THE CONTENTS THEREOF.

The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to this document or its contents without specific, written prior permission. Title to copyright in this document will at all times remain with copyright holders.

Notes

This version: http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231

This formulation of W3C's notice and license became active on December 31 2002. This version removes the copyright ownership notice such that this license can be used with materials other than those owned by the W3C, moves information on style sheets, DTDs, and schemas to the Copyright FAQ, reflects that ERCIM is now a host of the W3C, includes references to this specific dated version of the license, and removes the ambiguous grant of "use". See the older formulation for the policy prior to this date. Please see our Copyright FAQ for common questions about using materials from our site, such as the translating or annotating specifications.