- From: Florent Georges <fgeorges@fgeorges.org>
- Date: Sun, 20 May 2012 22:13:44 +0200
- To: mozer <xmlizer@gmail.com>
- Cc: XProc Comments <public-xml-processing-model-comments@w3.org>
On 20 May 2012 13:10, mozer wrote:
> Do you want to provide a default content ?
No.
> What is exactly the use case ?
There are two different aspects here. The first one is to be able
to declare a primary port just for the convenience of connecting it
implicitly, without imposing the user to write the following when
he/she doesn't want to pass it (this is really syntactic sugar, but
XProc syntax is sometimes rather salty, so I think it couldn't hurt):
<p:input port="source">
<p:empty/>
</p:input>
The second aspect is to check the documents flowing through a port,
by checking their root element name:
<p:declare-step type="my:format-article">
<p:input port="source" as="document-node(db:article)"/>
...
</p:declare-step>
Feeding the previous step with something else than a document with a
root element called "db:article" would then throw a type error, like
for the "as" attribute in XSLT 2.0.
Is it clearer or do you want a real use case?
Regards,
--
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/
Received on Sunday, 20 May 2012 20:14:34 UTC