Re: Viewport and nested selected nodes

/ Jeni Tennison <jeni@jenitennison.com> was heard to say:
| what happens when one selected <div> is a descendant of another
| selected <div>?
|
| I think that viewport should probably filter the selected nodes to
| only those that do not have another selected node as a descendant.

I had the opposite strategy in mind, where the filter selects the
"outermost" matching nodes and ignores nested matches.

So, given:

<body>
  <div class="o1">
    <div class="i1">
      <p/>
    </div>
  </div>
  <div class="o2">
    <p/>
  </div>
</body>

a viewport that processes "//div" will replace this subtree
with the results of processing it:

  <div class="o1">
    <div class="i1">
      <p/>
    </div>
  </div>

and this subtree with the results of processing it:

  <div class="o2">
    <p/>
  </div>

The "i1" div never gets called out as a match.

I could also live with calling this situation an error, but I'm
hesitate to suggested that we should look into the descendants before
filtering. I'd like to be able to analyze the expression and, for many
cases including //div, use a streaming implementation.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh
XML Standards Architect
Sun Microsystems, Inc.

Received on Monday, 23 October 2006 17:22:48 UTC