Re: Viewport and nested selected nodes

Alex Milowski wrote:
> 
> Norman Walsh wrote:
>> / Alex Milowski <alex@milowski.org> was heard to say:
>> | Jeni Tennison wrote:
>> |>
>> |> Hi,
>> |>
>> |> In the example of <p:viewport> in the spec:
>> |>
>> |> <p:viewport name="encdivs">
>> |>   <p:declare-input port="div" step="step" source="port"
>> |>                    select="//h:div[@class='enc']"/>
>> |>   <p:declare-output port="html" step="encrypt" source="result"/>
>> |>   <p:step name="encrypt" type="p:encrypt-document">
>> |>     <p:input name="document" step="encdivs" source="div"/>
>> |>   </:step>
>> |> </p:viewport>
>> |
>> | In the case of viewports, "//h:div" and "h:div" are equivalent.
>>
>> No, I don't think so. These are select patterns, not match patterns. I
>> would expect h:div to be the same as /h:div in this case, not //h:div.
> 
> That's an issue we should discuss because I've always imagined them
> as match patterns.
> 

Further thoughts...

So, in XSLT, a select attribute with a value of "//h:div" would return
all the "h:div" elements in the document.  In our case, we're going
to return only the outermost elements.  As such, it isn't the same thing
as a select pattern in XSLT.  Given that, it seems like we're going
to confuse users who come from XSLT-land.

Note that a match pattern doesn't suffer from that confusion because
the "apply" semantics will be very similar to XSLT's template matching.

For similar reasons to XSLT, I'd love to be able to restrict the
XPath expressions for computed ports, for-each, and viewport to match
patterns.

--Alex Milowski

Received on Tuesday, 24 October 2006 15:38:46 UTC