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

We didn’t specify (yet) that we accept arbitrary XDM items on ports. 
Currently documents flow through ports. I thought that, before we came 
up with the idea of proxy docs which we recently rejected, we agreed 
that non-XML documents are represented as empty document nodes with 
properties, therefore document-node()+ would match one to many XML *or 
non-XML* documents.

Specifying item() on an input or output port is not prima facie 
incompatible with document-node(). It needs to raise a dynamic error 
though when an atomic value or an array arrives on a port.

We need to have the conversation
1. whether to let arbitrary XDM values flow through ports (I thought we 
woulnd’t.)
2. whether to represent non-XML documents as empty document nodes, or 
maybe a text node wrapped in a document node for the special case of 
text documents. (I thought we did.)

If we agree on 2, we can have ordinary sequence tests on ports.

Some like <p:output port="result" as="xs:boolean?"/> might be illegal 
statically, unless/until we allow arbitrary XDM items to flow through 
ports. Others like <p:input port="source" as="item()"/> will be legal 
even if we only let documents flow between steps — until an atomic value 
arrives on the port, which will raise a dynamic error.

The as="…" notation with XPath sequence tests will provide a smooth 
migration path from “documents only on ports” to “arbitrary XDM values 
on ports” if we want to pursue this route.

Gerrit


On 25.09.2017 17:35, Norman Walsh wrote:
> "Imsieke, Gerrit, le-tex" <gerrit.imsieke@le-tex.de> writes:
>> I don’t think it will fit well into content-types.
>>
>> But we can think of allowing the as attribute also on input and output ports, like this:
>>
>> <p:input port="source" as="document-node(element(*))*"/>
>>
>> or
>>
>> <p:output port="result as="document-node()"/>
> 
> If “as=” takes an XPath sequence test, then I don’t see how to make
> that work with non-XML outputs. If it doesn’t take an XPath sequence
> test, then it’s going to be inconsistent with all the other uses of
> “as=”.
> 
>> As long we don’t permit arbitrary XDM items on ports, we need to raise
>> an error though (statically?) if the declared sequence type is atomic,
>> a map, or anything else except item() or document-node().
> 
> item() includes atomics. Since we allow binary nodes, I’m not sure why
> we’d forbid arbitrary XDM values (how is an xs:integer not an example
> of binary?)
> 
> I suppose we could say that “as=” is a sequence test with the special
> rule that document(), document()?, document()*, and document()+ may
> match non-XML documents.
> 
> Maybe.
> 
>                                          Be seeing you,
>                                            norm
> 

-- 
Gerrit Imsieke
Geschäftsführer / Managing Director
le-tex publishing services GmbH
Weissenfelser Str. 84, 04229 Leipzig, Germany
Phone +49 341 355356 110, Fax +49 341 355356 510
gerrit.imsieke@le-tex.de, http://www.le-tex.de

Registergericht / Commercial Register: Amtsgericht Leipzig
Registernummer / Registration Number: HRB 24930

Geschäftsführer: Gerrit Imsieke, Svea Jelonek,
Thomas Schmidt, Dr. Reinhard Vöckler
------------------------------------------------------------------------------
Meet us at Frankfurt Book Fair
Hall 4.2, L 72.

More at https://www.le-tex.de/en/buchmesse.html

Received on Monday, 25 September 2017 17:34:06 UTC