Re: Type of documents flowing through ports

Interesting .    I wonder how I could apply that to xmlsh pipelines and functions ...
Although it borders on verbosity .. It is the "xquery way" so must be good.


Sent from my iPad (excuse the terseness) 
David A Lee
dlee@calldei.com


On Apr 25, 2012, at 5:42 PM, "Florent Georges" <fgeorges@fgeorges.org> wrote:

>  Hi,
> 
>  I am not sure this has been notice yet for next version of XProc,
> but a lot of times, when I write steps aimed to be reused all accross
> the application (or as part of a library, so even more generic), I'd
> like to say that an input is optional.  Even no port at all has to be
> connected to in input or an output of my step (even though I'd like it
> to be primary for convenience...)
> 
>  I such cases, I would like to make the connection optional.  An
> attribute optional="true" (or required="false" to be consistent with
> what already exists) would be very handy.
> 
>  An pushing the concept a bit further, I think that being able to
> state the type of the document would help in a lot of cases to catch
> errors earlier.  Something like the XSLT "as" attribute (with
> occurrence constraints also allowed, like '?', '*' and '+'):
> 
>    <p:input port="source" as="document-node(db:article)"/>
> 
>  Without requiring validation, which requires more investment, like
> writing schemas, even for "being built so not entirely valid docs",
> this would catch the kind of errors when an unexpected document flows
> through an unexpected port...
> 
>  What do you think?
> 
>  Regards,
> 
> -- 
> Florent Georges
> http://fgeorges.org/
> http://h2oconsulting.be/
> 
> 

Received on Thursday, 26 April 2012 02:58:23 UTC