W3C home > Mailing lists > Public > public-xml-processing-model-wg@w3.org > August 2010

RE: Possible new XProc 1.1 step: p:template

From: <Toman_Vojtech@emc.com>
Date: Thu, 12 Aug 2010 12:33:22 -0400
Message-ID: <997C307BEB90984EBE935699389EC41C020EC179@CORPUSMX70C.corp.emc.com>
To: <public-xml-processing-model-wg@w3.org>
>  <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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 12 August 2010 16:34:28 GMT