<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>5002</bug_id>
          
          <creation_ts>2007-09-04 06:17:02 +0000</creation_ts>
          <short_desc>[XDM] Wrong use of the term &quot;root node&quot; in the XDM spec</short_desc>
          <delta_ts>2007-11-19 21:34:05 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Data Model 1.0</component>
          <version>Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.w3.org/TR/xpath-datamodel</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mukul Gandhi">mukul_gandhi</reporter>
          <assigned_to name="Anders Berglund">alb.w3c</assigned_to>
          <cc>mukul_gandhi</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>16353</commentid>
    <comment_count>0</comment_count>
    <who name="Mukul Gandhi">mukul_gandhi</who>
    <bug_when>2007-09-04 06:17:02 +0000</bug_when>
    <thetext>I found an inconsistency in a terminology in the &quot;XQuery 1.0 and XPath 2.0 Data Model&quot; specification (http://www.w3.org/TR/xpath-datamodel).

Section 2.1 Terminology mentions:
Every node is one of the seven kinds of nodes defined in &quot;6 Nodes&quot;. Nodes form a tree that consists of a root node plus all the nodes that are reachable directly or indirectly from the root node via the dm:children, dm:attributes, and dm:namespace-nodes accessors. Every node belongs to exactly one tree, and every tree has exactly one root node.

The reference to the term, &quot;root node&quot; in this paragraph seems wrong. XPath 2.0 &amp; XQuery 1.0 now use the term document node. 

Then in the same section, it&apos;s defined, &quot;A tree whose root node is a Document Node is referred to as a document&quot;.

And, &quot;A tree whose root node is not a Document Node is referred to as a fragment&quot;.

Then in section, &quot;2.4 Document Order&quot;, it&apos;s written: The root node is the first node.

Also in section, &quot;D Glossary (Non-Normative)&quot;, the term root node is used.

Although the concept of &quot;root node&quot; does not exist in &quot;XQuery 1.0 and XPath 2.0 Data Model&quot;, this term is used at many places in this specification.

If &quot;root node&quot; is a valid concept in XQuery 1.0 and XPath 2.0, I think, it should be clearly defined in the data model specification. 

As per my knowledge, the concept of &quot;root node&quot; is now replaced by &quot;document node&quot; in XQuery &amp; XPath 2.0. 

If I am correct, then references to the term &quot;root node&quot; should be removed from the &quot;XQuery 1.0 and XPath 2.0 Data Model&quot; specification, and replaced with &quot;document node&quot;. Or, the concept of &quot;root node&quot; should be defined, if such a node type exists in the data model (which to me is not a valid node type in the data mode, as per the specification).

Regards,
Mukul</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16370</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2007-09-05 12:08:44 +0000</bug_when>
    <thetext>Personal response: although there&apos;s a tortuous history here, involving differences of terminology between XML 1.0, XPath 1.0, and XDM, I don&apos;t think the XDM spec can be faulted for these definitions. You are reading &quot;root node&quot; as if it were a kind of node, which is a reasonable misunderstanding given the history, but XDM makes it very plain in the section you are quoting that being a root is essentially a relationship between a node and a tree.

It&apos;s true that the spec uses the term &quot;root node&quot; without a formal definition, but the sentence &quot;Nodes form a tree that consists of a root node plus all the nodes that are reachable directly or indirectly from the root node&quot; is pretty close to a formal definition (of both &quot;root&quot; and &quot;tree&quot;) and certainly seems adequate to me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16433</commentid>
    <comment_count>2</comment_count>
    <who name="Mukul Gandhi">mukul_gandhi</who>
    <bug_when>2007-09-09 14:16:01 +0000</bug_when>
    <thetext>Hi Mike,
  Thanks for your response. Please find below my further comments on this topic.

The XDM spec states (in section, 2.1 Terminology):
1) Every node is one of the seven kinds of nodes defined in 6 Nodes. Nodes form a tree that consists of a root node plus all the nodes that are reachable directly or indirectly from the root node via the dm:children, dm:attributes, and dm:namespace-nodes accessors.
2) A tree whose root node is a Document Node is referred to as a document.
3) A tree whose root node is not a Document Node is referred to as a fragment.

I think the &quot;root node&quot; concept in XDM is fine, and this terminology can coexist with 7 kinds of nodes possible in XDM (which are presently defined).

But I suggest adding following definitions to the section, 2.1 Terminology.  
A tree is a logical structure which is constructed from the nodes, which represent a document or a fragment.
The root node of the tree, is it&apos;s top most node, which could be a document node, or it can be the root node of a fragment.

This will define the concept of root node unambiguously.

Regards,
Mukul</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16806</commentid>
    <comment_count>3</comment_count>
    <who name="Anders Berglund">alb.w3c</who>
    <bug_when>2007-09-26 14:52:20 +0000</bug_when>
    <thetext>The XSL and XQuery WGs discussed this and decided to add a definition of &quot;root node&quot; (even though the term is used in its normal meaning in the context of &quot;tree structures&quot;). Proposed text:

[Definition: The topmost node of a tree is called the root node.]

Note: Thus the root node is merely a designator, based on position,
for one of the nodes in the tree without implying what kind of
a node it is.
In the XPath 1.0 datamodel the root node was a kind of node.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>