W3C home > Mailing lists > Public > public-xml-processing-model-comments@w3.org > April 2012

Type of documents flowing through ports

From: Florent Georges <fgeorges@fgeorges.org>
Date: Wed, 25 Apr 2012 23:41:51 +0200
Message-ID: <CADyR_r2pcctrGAmtzdqnDS316f2Su=h9P4=Uxb+eFfWreGNU2A@mail.gmail.com>
To: XProc Comments <public-xml-processing-model-comments@w3.org>

  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?


Florent Georges
Received on Wednesday, 25 April 2012 21:42:46 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:28:28 UTC