Subject: [Simple] XCAP issue 7: uniqueness in intermediate hops

From: Jonathan Rosenberg <[email-masked]>
Date: Tue, 11 May 2004 13:29:28 -0400

Joel Halpern raised an excellent question during the tutorial in Seoul 
that requires some discussion.

The question was whether xcap requires that, at each step in the node 
selector (that is, each "path segment" between the "/") that a single 
node is selected, or just that the final expression selects a single 
node. A concrete example (courtesy of Joel):

<aTags>
    <aTag>
       <bTags>
          <bTag at1="1"> content </bTag>
          <bTag at1="2"> content </btag>
       </bTags>
       <othertags at2="x"> content </othertags>
    </aTag>
    <aTag>
        <bTags>
          <bTag at1="3"> content </bTag>
          <bTag at1="4"> content </btag>
       </bTags>
       <othertags at2="y"> content </othertags>
    </aTag>
</aTags>

is it legal to have an XCAP reference of the form
.../document/aTags/aTag/bTags/bTag[@at1="1"]

The above expression does indeed select a single bTag element, but you 
don't know that this element is the one in the top tree until you get to 
the last selector.

XPath allows this kind of thing. We have the option of disallowing it or 
allowing it.

It is my inclination to disallow it, entirely from a "keep it simple" 
perspective. I think that introducing this restriction (each step 
selects a single element) is likely to result in a much leaner 
implementation, as you can easily traverse the tree in a simple way, 
each step selecting a single next node. Without this, you need to 
maintain a set of "candidates", and evaluate each next step against the 
current candidate set.

 From a performance perspective, without this limitation, its possible 
that the operation of selecting the target node can be O(N) where N is 
the number of nodes in the tree, vs. O(log(N)) which, for a balanced 
tree, would be the case where a single element is selected at each step.

Do other agree that we should introduce the restriction that each step 
in the processing result in a unique node?

Thanks,
Jonathan R.

-- 
Jonathan D. Rosenberg, Ph.D.                600 Lanidex Plaza
Chief Technology Officer                    Parsippany, NJ 07054-2711
dynamicsoft
[email-masked]                     FAX:   (973) 952-5050
http://www.jdrosen.net                      PHONE: (973) 952-5000
http://www.dynamicsoft.com

_______________________________________________
Simple mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/simple