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

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.)

Second: Norm said:
> 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.

So: Whatever appear on the input or output port of a step is a document (but not necessary an xml document). A document is an item(), but not every item() is a document(). Especially no instance of xs:integer fulfils document().

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.
------------------------------------------------
Achim Berndzen
achim.berndzen@xml-project.com

<xml-project /> Achim Berndzen
Kleine Breite 26a
38302 Wolfenbüttel, Germany

http://www.xml-project.com





> Am 25.09.2017 um 19:33 schrieb Imsieke, Gerrit, le-tex <gerrit.imsieke@le-tex.de>:
> 
> 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:54:03 UTC