Node

節点 (DOM、SGML、XML)

[24] DOMHTMLXMLXDMSGML 特性集合における節点 (ノード) (node) は、 マーク付け言語やそれに対応するデータモデルにおけるグラフの構造における情報の単位です。

節点 (DOM)

[1] Node 界面は、 DOM で最も重要なデータ型です。 これは文書木中の一つの (ノード) を表します。 (但し実際的には Node 型そのものの節の実現値は存在せず、 Node を継承した、例えば Element 型の節として存在します。)

[2] Node 界面の method などの中には、 特定種類の節に対しては意味を成さないものもあります。 そうしたものは null や例外が返されるかもしれません。 (それぞれ個々の場合ごとに決まっています。)

継承関係

[13] Node インターフェイスEventTarget インターフェイス継承しています。

[14] Node インターフェイス継承した主たるインターフェイスとして ParentNodeChildNode があります。 DOM Standard で定義されている節点はすべてこのいずれか(のみ)を継承しています。

[15] この2つは DOM Standard で追加されたので、 DOM3 以前はありませんでした。 DOM3 までは Node継承していて今は継承していない Attr と、 DOM3 まではあって今は廃止された Entity, EntityReference, Notation, XPathNamespaceDOMDTDEF (非標準) の ElementTypeDefinition, AttributeDefinition はどちらも継承していません。 DOM3 まであって DOM Standard で廃止された CDATASectionText継承しているので、 (仮に現在もあれば) ChildNode継承することになります。

状態

[33]

節点文書
当該節点が所属する文書です。
文書中
文書かどうかを表します。
根を含む文書中
影を含む根文書かどうかを表します。

[34] 他に、節点の種別に依存した状態を持ちます。

各項を参照。

メンバー

[35]

定数群NodeType:
定数ELEMENT_NODE := 1要素節[DOM1]
定数ATTRIBUTE_NODE := 2属性節[DOM1]
定数TEXT_NODE := 3文節[DOM1]
定数CDATA_SECTION_NODE := 4文字データ区間節[DOM1]
定数ENTITY_REFERENCE_NODE := 5実体参照節[DOM1]
定数ENTITY_NODE := 6実体節[DOM1]
定数PROCESSING_INSTRUCTION_NODE := 7処理指令節[DOM1]
定数COMMENT_NODE := 8注釈節[DOM1]
定数DOCUMENT_NODE := 9文書節[DOM1]
定数DOCUMENT_TYPE_NODE := 10文書型節[DOM1]
定数DOCUMENT_FRAGMENT_NODE := 11文書断片節[DOM1]
定数NOTATION_NODE := 12記法節[DOM1]
定数200 まで (up to)(W3C が予約)[DOM2]
allHTMLElement (WinIE 4)
childrenHTMLElement (WinIE 4)
containsHTMLElement (WinIE 4)
documentHTMLElement (WinIE 4)
読取専用属性nodeName節名[DOM1]
読取専用属性localName局部名[DOM2]
読取専用属性namespaceURI名前空間名[DOM2]
属性prefix名前空間接頭辞[DOM2]
属性nodeValue節値[DOM1]
読取専用属性nodeType節型[DOM1]
読取専用属性parentNode親節[DOM1]
読取専用属性childNodes子節達[DOM1]
childrenHTMLElement (Trident)
読取専用属性firstChild最初の子節[DOM1]
読取専用属性lastChild最後の子節[DOM1]
読取専用属性previousSiblingすぐ兄の節[DOM1]
parentElementHTMLElement (WinIE 4)
読取専用属性nextSiblingすぐ弟の節[DOM1]
読取専用属性attributes属性達[DOM1]
読取専用属性ownerDocument所属文書[DOM1], [DOM2]
methodinsertBefore直前に節挿入[DOM1]
methodreplaceChild子節を置換[DOM1]
methodremoveChild子節を削除[DOM1]
swapNodeDOMNode (Trident)
methodappendChild子節を付加[DOM1]
methodhasChildNodes子節を持つか[DOM1]
methodhasAttributes属性を持つか[DOM2]
methodcloneNode節を複製[DOM1]
methodnormalize正規化[DOM2]
methodisSupported機能対応有無[DOM2]

[7]

Interface NodeExtended
  Attributes
    isBlankNode of type boolean
      Whether the node is blank or not.
      
      @@ What is _blank_?  How different from "hasChildNodes"?
      
      Source: PHP
    offset of type long
      The child index of the node within its parent.
      (?? If the node does not have a parent,
          "-1" is returned.  If the node is the
          first child, "0" is returned. ??)
      Source: eDOM
    parentElement of type Element
      Nearest ancestor or self node which is an element node.
      (?? If there is no ancestor or self node whose
          type is element, the value is "null". ??)
      (?? For Attr, ? is returned. ??)
      Source: WinIE, Safari, eDOM
    removeChildOnly
      Replaces a child node by its children.  In other word,
      removes a node but not the descendants of that node.
      Source: eDOM [defined for Element]
      
      Parameters
        oldChild of type Node
          A node to remove.
      Return Value
        Node      "oldChild" is returned.
      Exceptions
        DOMException HIERARCHY_ERR, NO_MODIFICATION_ALLOWED_ERR
    replaceChildOnly
      Replaces a child node by another node and moves
      the children of the original node into the new node.
      Attributes of the original node are copied to
      the new one if the nodes are elements.
      (?? oldChild and newChild is different type ??)
      Source: eDOM [defined for Element]
      Parameters
        oldChild of type Node
          Child node to replace.
          (?? childToReplace in eDOM ??)
        newChild of type Node
          New child node to replace by.
          (?? newChildName (XHTML local element type name)
              of type DOMString in eDOM ??)
  Methods
    addNamespace
      Adds a namespace declaration attribute to a node.
      
      @@ What if already exist? overwrites?
      
      Source: PHP
      Parameters
        namespaceURI of type DOMString
        prefix of type DOMString
      No Return Value
    descendant
      Returns whether a node is ancestor of the node.
      Source: eDOM
      
      Parameters
        possibleAncestor of type Node
          A node that could be the ancestor of this node.
          (?? eDOM restricts to "element node". ??)
      Return Value
        boolean "true" if "possibleAncestor" is the
                ancestor of this node; "false" otherwise.
                (?? "false" if "possibleAncestor" is 
                    this node itself. ??)
      No Exceptions

[8] IE6 はノードに追加したオレオレプロパティが消せない(delete document.body.hoge が出来ない) - latest log ( 版) <http://d.hatena.ne.jp/uupaa/20090924/1253734273>

[16] 911477 – Implement DOM4 methods: prepend(), append(), before(), after() and replace() ( ( 版)) <https://bugzilla.mozilla.org/show_bug.cgi?id=911477>

適合性

[36]節点の項および要素の内容の適合性の項を参照。

節点 (XDM)

[9] XML Path Language (XPath) 2.0 (Second Edition) ( ( 版)) <http://www.w3.org/TR/2010/REC-xpath20-20101214/#dt-node>

[10] XQuery 3.0: An XML Query Language ( ( 版)) <http://www.w3.org/TR/xquery-30/#dt-node>

[11] XML Path Language (XPath) 3.0 ( ( 版)) <http://www.w3.org/TR/xpath-30/#dt-node>

[12] XQuery and XPath Data Model 3.0 ( ( 版)) <http://www.w3.org/TR/xpath-datamodel-3/#Node>

節点 (SGML)

[23] ISO/IEC 10744:1997 3.80 >>21 (原文は英語)

3.80 節点 (node)
木立において、一つの物体表現する特性の順序付き集合

[17] JIS X 4153:1998 4.19

ノード (Node)
特性割当て順序付き集合グローブの要素であって、グローブ構築に用いるグローブ設計において定義するクラスに属する。

[18] 節点は、特性割当て (property assignment) の順序付き集合です。 節点の各特性割当ては特性名を (value) と関連付けます。 ここで、特性名は節点級種が提供する特性の名前であり、 その順序が特性割当ての順序となります。

[19] 節点は、ある特性に値を関連付ける特性割当てを持つ時、 その特性に値を示す (exhibit) といいます。 節点の特性 (property of a node) とは、 その節点が値を示す特性のことを言います。 節点はその特性所有者 (owner) であると言います。

仕様書

情報項目 (XML 情報集合)

[26] XML情報集合では、節点のことを情報項目 (information item) と呼んでいます。

仕様書

情報項目

[28] 情報項目は、XML文書の一部を抽象的に説明するものです >>25

[27] 情報集合は、数々の情報項目によって構成されます。 整形式 XML文書情報集合は、最低でも文書情報項目を含みます。 >>25

[29] 情報項目は、いくつかの特性を持ちます >>25

[31] 情報項目には、次の種類があります。

メモ

[32] 19007 – Consider adding a swap() method ( 版) <https://www.w3.org/Bugs/Public/show_bug.cgi?id=19007>

[37] Make Attr inherit from Node again (annevk著, ) <https://github.com/whatwg/dom/commit/625a0747f137454c155a7b577a9e45be1aa35a34>

[38] Editorial: define more in terms of the length concept (annevk著, ) <https://github.com/whatwg/dom/commit/74ebe9ff443196aa5913d101cdf87ee9274722e2>