Re: [EXTERNAL] - Getting rid of @sequence="true/false"?

Achim Berndzen <achim.berndzen@xml-project.com> writes:
> Sorry, I am totally confused now:
>
> First: I agree with Gerrit that we didn't specify arbitrary XDM items
> on port. (And I think we should not do so.)

Ok. But if we allow non-XML documents to flow through the pipeline, if
the language is going to let me construct an arbitrary octet sequence
and send it as a result, I don’t see how there’s any provision for
*preventing* me from sending arbitrary XDM values.

But that doesn’t mean that the language has to recognize them, that we
have to allow you to match them (with <p:output port="result"
as="xs:boolean"/>, for example) of course.

> I am very much in favour of the idea of specifying the cardinality
> expected (or delivered) on a port. My only reservation against
> something like
>
>> <p:input port="source" as="document-node(element(*))*"/>
>
> is that it is to long and to error prone.

My reservations are two-fold, first, I think you’re right, it’s long
and error prone. Second, if we aren’t going to allow arbitrary XDM
values, then it’s a weird subset of sequence constructors that I don’t
really want to have to teach users.

We want to remove sequence=true/false; would simply adding a
“cardinality” attribute suffice? (Well, except for the fact that
cardinality is a terrible, technical name for the attribute.)

We could add “at-least” and “at-most” attributes, where they both
default to 1.

  <p:input port="source" at-least="5" at-most=”7"/>

I’m not wholly enthusiastic because I think there’s no compelling
use-case for more control than ?, *, and +. How about occurrence?

  <p:input port="source" occurrence="*"/>

Probably still to arbitrary and technical. Maybe

  <p:input port="source" as="document-node()*"/>

isn’t that bad. :-)

1. It only has to be in the declarations, so most users will never have
   to type it.
2. Even if users create their own steps, they aren’t required to type it.
3. It’s very unlikely that users are going to do anything more complicated
   than just document-node(). Because, while "document-node(element(*,my:HatSize))+"
   would be valid, it would only be valid if that output port produced only
   hat size documents. I have a feeling that ports that produce more than
   one document more often than not produce different kinds of documents.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh
Lead Engineer
MarkLogic Corporation
Phone: +1 512 761 6676
www.marklogic.com

Received on Tuesday, 26 September 2017 07:11:12 UTC