XPath 1.0データ・モデル

XPath 1.0 データモデル

[11] XPath 1.0データモデルは、 XPath 1.0 が採用している XML文書の内部表現形式です。 XPath 1.0 の他、 XPath 1.0 を採用する XSLT 1.0 などの言語で使われています。

節点木データモデル

元々の XPath 1.0

DOM XPath のデータモデル

[15] DOM3 XPathDOMXPath 1.0データモデルに合わせるため名前空間節点DOM に追加するなどしていますが、実装には無視されていました。

[3] ChromeFirefox とも DocumentType 節点が存在します。 string()name()空文字列になります。

[7] 根節点の扱いについては、根節点の項を参照してください。

XSLT のデータモデル

[8] 根節点の拡張については、根節点の項を参照してください。

[16] template 要素の扱いは、 DOM XPathXSLT 1.0 とで異なっています。 template

[4] XSL Transformations (XSLT) Version 1.1 ( 版) http://www.w3.org/TR/xslt11/#N11359

[13] RFC 7950 - The YANG 1.1 Data Modeling Language () https://tools.ietf.org/html/rfc7950#section-6.4

The data model used in the XPath expressions is the same as that used in XPath 1.0 [XPATH], with the same extension for root node children as used by XSLT 1.0 (see Section 3.1 in [XSLT]). Specifically, it means that the root node may have any number of element nodes as its children.

XPointer

[9] 根節点の拡張については、根節点の項を参照してください。

XForms

[5] XForms 1.1 ( 版) http://www.w3.org/TR/xforms/#expr-instance

X#

[2] X Sharp/Data Types ( 版) http://wiki.codeglide.com/X_Sharp/Data_Types#Node

The X# Document Object Model implementation supports all six XML node types:

  • Element
  • Attribute
  • Text (Unicode and Binary text nodes are permitted)
  • Namespace
  • Comment
  • Processing Instruction

「Binary text nodes」

データ型

[14] XPath 1.0 には次のデータ型があります。

歴史

[12] XPath 1.0データモデルは、 XML情報集合の設計上のベースとなったデータモデルの1つです。

[10] XPath 2.0/XSLT 2.0 以降は XDM を使っています。 XDMXPath 1.0のデータモデルをベースにしているようですが、大きく変更されています。

実装

[6] 760029 – XPath expression `//node()` shouldn’t match the DOCTYPE node ( ( 版)) https://bugzilla.mozilla.org/show_bug.cgi?id=760029

メモ

[1]

DataModel:
  @FullName:
    @@lang:en
    @@@:
      XPath 1.0 Data Model
  
  @ImplNote:
    @@lang:en
    @@@:
      A namespace URI of an expanded-name should be resolved 
      to an absolute URI reference.
      \
      {P:: Two expanded-names are equal if:
         \
         - they have the same local part and
         \
         - both have a null namespace URI or  
           both have non-null namespace URIs that are equal.
         \
      }
  @ImplNote:
    @@lang:en
    @@@:
      {LI:: DFN:document order:: The order in which the first 
        character of the XML representation of each node 
        occurs in the document after expansion of general entities. 
        \
        - The attribute nodes and namespace nodes occur before 
          the children of the element.
        \
        - The namespace nodes occur before the attribute nodes.
        \
        - The relative order of namespace nodes and the attribute nodes 
          is implementation-dependent.
        \
      }
      \
      - DFN:reverse document order:: The reverse of document order.
  @ImplNote:
    @@lang:en
    @@@:
      - DFN:descendants:: The children of the node and 
                            the descendants of the children.
  
  @InfoItem:
    @@FullName:
      @@@lang:en
      @@@@: root node
    @@Description:
      @@@lang:en
      @@@@:
        The root of the tree.  A root node does not occur except 
        as the root of the tree.
    @@Prop:
      @@@Description:
        @@@@lang:en
        @@@@@: An ordered list of child nodes.
    @@Prop:
      @@@Name:string-value
      @@@Description:
        @@@@lang:en
        @@@@@:
          The concatenation of the CODE:string-values of all 
          text node descendants of the root node in document order.
  
  @InfoItem:
    @@FullName:
      @@@lang:en
      @@@@:element node
    @@InfoProp:
      @@@Name:expanded-name
      @@@Description:
        @@@@lang:en
        @@@@@:
          Computed by expanding the CODE:QName of the element 
          specified in the tag.  The namespace URI will be null 
          if the CODE:QName has no prefix and there is no 
          applicable default namespace.
    @@InfoProp:
      @@@Name:children
      @@@Description:
        @@@@lang:en
        @@@@@:
          An ordered list of child nodes.  Note that entity references 
          are expanded and character references are resolved.
    @@InfoProp:
      @@@Name:string-value
      @@@Description:
        @@@@lang:en
        @@@@@:
          The concatenation of the CODE:string-values of all 
          text node descendants in document order.
    @@InfoProp:
      @@@FullName:
        @@@@lang:en
        @@@@@: unique identifier
      @@@Description:
        @@@@lang:en
        @@@@@:
          The DTD-determined ID value.  Note that if an XML processor 
          reports two elements in a document as having the same unique 
          ID, the second element in document order must be treated 
          as not having a unique ID.
    @@InfoProp:
      @@FullName:
        @@@lang:en
        @@@@:parent

  @InfoItem:
    @@FullName:
      @@@lang:en
      @@@@:attribute node
    @@InfoProp:
      @@@FullName:
        @@@@lang:en
        @@@@@:parent
      @@@Description:
        @@@@lang:en
        @@@@@:
          The owner element.  Note that an attribute node is not 
          a child of the parent element.
    @@ImplNote:
      @@@lang:en
      @@@@:
        Default attributes are treated the same as specified ones.
    @@InfoProp:
      @@@FullName:
        @@@@lang:en
        @@@@@:expanded-name
      @@@Description:
        @@@@lang:en
        @@@@@:
          Computed by expanding the CODE:QName specified in the tag. 
          The namespace URI will be null if the CODE:QName does 
          not have a prefix.
    @@InfoProp:
      @@@FullName:
        @@@@lang:en
        @@@@@:string-value
      @@@Description:
        @@@@lang:en
        @@@@@:
          The normalized value.  Note that is might be a zero-length string.

  @InfoItem:
    @@FullName:
      @@@lang:en
      @@@@:namespace node
    @@Description:
      @@@lang:en
      @@@@:
        In-scope namespace declarations, including implied 
        XML:xml namespace declaration.
        \
        {NOTE:: An XML:xmlns="" attribute undeclares the 
                default namespace; that element and its 
                descendants have no default namespace node.
        \
        }
    @@InfoProp:
      @@@FullName:
        @@@@lang:en
        @@@@@:parent
      @@@Description:
        @@@@lang:en
        @@@@@:
          The owner element.  Note that a namespace node is not a 
          child of the parent element.
    @@InfoProp:
      @@@FullName:
        @@@@lang:en
        @@@@@:expanded-name
      @@@Description:
        @@@@lang:en
        @@@@@:
          The local part is the namespace prefix or empty if 
          the namespace node is for the default namespace.  
          The namespace URI is always null.
    @@InfoProp:
      @@@FullName:
        @@@@lang:en
        @@@@@:string-value
      @@@Description:
        @@@@lang:en
        @@@@@:
          The namespace URI bound to the prefix.  If it is a relative 
          URI, it must be resolved.

  @InfoItem:
    @@FullName:
       @@@lang:en
       @@@@:processing instruction node
    @@InfoProp:
      @@@FullName:
        @@@@lang:en
        @@@@@:parent
    @@InfoProp:
      @@@FullName:
        @@@@lang:en
        @@@@@:expanded-name
      @@@Description:
        @@@@lang:en
        @@@@@:
          The local part is the target.  The namespace URI is null.
    @@InfoProp:
      @@@FullName:
        @@@@lang:en
        @@@@@:string-value
      @@@Description:
        @@@@lang:en
        @@@@@:
          The target data (following the target name and any white space).

  @InfoItem:
    @@FullName:
      @@@lang:en
      @@@@:comment node
    @@InfoProp:
      @@@FullName:
        @@@@lang:en
        @@@@@:parent
    @@InfoProp:
      @@@FullName:
        @@@@lang:en
        @@@@@:string-value
      @@@Description:
        @@@@lang:en
        @@@@@:
          The content of the comment.
  @InfoItem:
    @@FullName:
      @@@lang:en
      @@@@:text node
    @@InfoProp:
      @@@FullName:
        @@@@lang:en
        @@@@@:parent
    @@InfoProp:
      @@@FullName:
        @@@@lang:en
        @@@@@:string-value
      @@@Description:
        @@@@lang:en
        @@@@@:
          The character data, always has at least one character.