Re: Type of documents flowing through ports

Florent,

Do you want to provide a default content ?

What is exactly the use case ?

Xmlizer

2012/4/25 Florent Georges <fgeorges@fgeorges.org>

>  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 Sunday, 20 May 2012 11:10:50 UTC