RE: Possible new XProc 1.1 step: p:template

>  <p:template match="...">
>   [XML goes here, with {} interpreted in both attr vals and text
content,
>    and something like <c:copy select="..."/> recognised]
>  </p:template>
> 
> This would allow the following simplifications (drawn from real
> examples):
> 
>  Replace
> 
>   <p:insert position="first-child">
>   <p:input port="insertion">
>    <p:inline><Timestamp><here/></Timestamp></p:inline>
>   </p:input>
>  </p:insert>
> 
>  <p:string-replace match="mt:Timestamp/mt:here">
>   <p:with-option name="replace"
select="concat('&quot;',$stamp,'&quot;')"/>
>  </p:string-replace>
> 
>  with
> 
>  <p:template match="/top">
>   <top>
>    <c:copy select="@*"/>
>    <Timestamp>{$stamp}</Timestamp>
>    <c:copy select="node()"/>
>   </top>
>  </p:template>

>From the examples above, I don't see if p:template would be a step or a
binding. (I expect it to be a step, but I don't see an input port.)
Personally, I think that making it a step would be more flexible because
you could then, for instance, use other steps to dynamically construct
the "template XML document" and then pass it to p:template.

Vojtech

--
Vojtech Toman
Consultant Software Engineer
EMC | Information Intelligence Group
vojtech.toman@emc.com
http://developer.emc.com/xmltech

Received on Thursday, 12 August 2010 16:34:27 UTC