Directed vs Generic Syntax

Taking the following example from Jeni Tennison's email:

<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>

 From my perspective, I see a mix of directed syntax (if, then, else) and
generic steps.  It could be argued that this are pipeline flow control
and the others are steps.

I've been in favor of using directed syntaxes for everything.  Much like
ant tasks, the step syntax is indicated by using a directed vocabulary.
So, in ant, XSLT is the element 'xslt'.

 From that, the above becomes:

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

This means the pipeline compiler needs to understand each directed
syntax--including extension steps.  While this adds to the implementors
work, I think the end result is far simpler for the user.

--Alex Milowski

Received on Thursday, 13 April 2006 15:19:43 UTC