RE: implicit option connections

Hi Martin, 

This was actually the only reason why I preferred using parameters than options : I want to use them "anywhere", which was satisfied by the natural propagation of them. 
Actually I'm not sure if parameters are still part of the 3.0 spec, looks like they are ? (why do I have the impress they have been made obsolete??)

Anyway I agree with you : implicit option connection would make the code easier to write and to read.

But maybe debugging might become more difficult in some cases where there are several calls to steps which make it unclear where the initial value of the option comes from ?

What about a debugging format where implicit things are made explicit (using XSLT or something else) ?
(just like Relax NG has a simplified - and helpful - format defined in the spec)


Cheers, 

Matthieu Ricaud-Dussarget
Expert XML
SI EDITORIAL
m.ricaud-dussarget@lefebvre-sarrut.eu
Tél : 01 40 92 21 98
80 Avenue de la Marne - 92120 Montrouge



-----Message d'origine-----
De : Martin Kraetke, le-tex [mailto:martin.kraetke@le-tex.de] 
Envoyé : jeudi 30 novembre 2017 11:21
À : xproc-dev@w3.org
Objet : implicit option connections

Hi,

In XProc 1.0 primary input and output ports are implicitly connected, if no explicit connection is declared. This is very convenient, because you can write more compact code.

I wonder if we can have the same feature for options in XProc 3.0? In our pipelines, we use frequently the same set of options. With 1.0 we are forced to declare them explicitely for each step. IMHO, this results in many redundant code lines and makes the pipeline harder to read. 
Therefore, I would propose to specifiy implicit option connections for 3.0:

If one or more options are in the scope of a step which expects these options, they should be automatically passed to the step. In this case, it should not be required to declare them explicitely with <p:with-option> unless you want to.

The pipeline below provides a brief demonstration of implicitely connected options.

<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
   xmlns:c="http://www.w3.org/ns/xproc-step"
   version="3.0">

   <p:input port="source">
     <p:inline>
       <doc>Hello world!</doc>
     </p:inline>
   </p:input>
   <p:output port="result"/>

   <p:option name="attribute-name" select="'foo'"/>
   <p:option name="attribute-value" select="'bar'"/>

   <p:add-attribute match="/doc"/>

</p:declare-step>

In case, you want to avoid an implicit connection, the easiest way to do so is to declare the option explitely. If you do not want that the option is declared at all, I would suggest to add an empty <p:with-option/> for that step.

Please let me know, what do you think about implicit option connections?

Kind regards,

Martin

--
Martin Kraetke
Lead Content Engineer
le-tex publishing services GmbH

Weissenfelser Str. 84, 04229 Leipzig, Germany Phone +49 341 355356 143, Fax +49 341 355356 543 martin.kraetke@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

Received on Thursday, 30 November 2017 16:25:25 UTC