Simple syntax (Was: Re: XProc: An XML Pipeline Language)

Norman Walsh wrote:
> / Rui Lopes <rlopes@di.fc.ul.pt> was heard to say:
> | 2) "load" component: I don't undestand the difference between having this
> | component instead of implicit URIs declared in some step. From your other post
> | to the mailing list I understand the need for the "save" component.
> 
> It's probably not a necessary component, if we allow an href or src
> attribute on a p:input element, but I still think it's probably useful
> to provide it for completeness sake.

I like the idea of hiding fundamental components such as "load", "save", 
"tee" and "identity" from users as much as possible.

For the sake of simplicity, perhaps a shorthand for the save component 
could be to have an optional href attribute on <p:output>, and a save 
attribute that defaults to true if the href attribute is present. Having 
default input/output names might also make defining pipelines a bit less 
tedious. In other words:

   <p:if input="$document" test="/foo">
     <p:then>
       <p:step name="xslt">
         <p:input select="$document" />
         <p:input name="stylesheet" href="foo.xsl" />
         <p:output href="result.xml" />
       </p:step>
     </p:then>
     <p:else>
       <p:step name="xslt">
         <p:input select="$document" />
         <p:input name="stylesheet" href="bar.xsl" />
         <p:output href="result.xml" />
       </p:step>
    </p:else>
   </p:if>

is a moderately readable shorthand for the comparatively scary:

   <p:step name="tee">
     <p:input name="input" select="$document" />
     <p:output name="copy1" label="doc1" />
     <p:output name="copy2" label="doc2" />
   </p:step>
   <p:if input="$doc1" test="/foo">
     <p:then>
       <p:step name="load">
         <p:param name="href" select="foo.xsl" />
         <p:output name="output" label="stylesheet" />
       </p:step>
       <p:step name="xslt">
         <p:input name="input" select="$doc2" />
         <p:input name="stylesheet" select="$stylesheet" />
         <p:output name="output" label="result" />
       </p:step>
       <p:step name="save">
         <p:input name="input" select="$result" />
         <p:param name="href" select="result.xml" />
       </p:step>
     </p:then>
     <p:else>
       <p:step name="load">
         <p:param name="href" select="bar.xsl" />
         <p:output name="output" label="stylesheet" />
       </p:step>
       <p:step name="xslt">
         <p:input name="input" select="$doc2" />
         <p:input name="stylesheet" select="$stylesheet" />
         <p:output name="output" label="result" />
       </p:step>
       <p:step name="save">
         <p:input name="input" select="$result" />
         <p:param name="href" select="result.xml" />
       </p:step>
     </p:else>
   </p:if>

Cheers,

Jeni
-- 
Jeni Tennison
http://www.jenitennison.com

Received on Wednesday, 12 April 2006 11:56:05 UTC