- From: <Toman_Vojtech@emc.com>
- Date: Fri, 19 Sep 2008 02:39:43 -0400
- To: <public-xml-processing-model-wg@w3.org>
What about this? (Still not the most elegant solution, though...)
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" name="pipe">
<p:input port="source">
<p:inline><doc>A</doc></p:inline>
</p:input>
<p:input port="alternate">
<p:inline><doc>A</doc></p:inline>
</p:input>
<p:output port="result"/>
<p:compare name="comparison" fail-if-not-equal="true">
<p:input port="source">
<p:pipe step="pipe" port="source" />
</p:input>
<p:input port="alternate">
<p:pipe step="pipe" port="alternate" />
</p:input>
</p:compare>
<p:split-sequence initial-only="true" test="position()=1">
<p:input port="source">
<p:pipe name="pipe" port="source"/>
<p:pipe name="comparison" port="result"/>
</p:input>
</p:split-sequence>
</p:declare-step>
Regards,
Vojtech
> -----Original Message-----
> From: public-xml-processing-model-wg-request@w3.org
> [mailto:public-xml-processing-model-wg-request@w3.org] On
> Behalf Of Norman Walsh
> Sent: Thursday, September 18, 2008 9:26 PM
> To: public-xml-processing-model-wg@w3.org
> Subject: How to use p:compare
>
> I got this off the xproc list and I'm having trouble figuring out what
> the right answer is.
>
> What's the easiest way to write a step that compares two documents and
> returns one of them if they're the same? If they're different, it
> throws an error
>
> Be seeing you,
> norm
>
> --
> Norman Walsh <ndw@nwalsh.com> | Never contend with a man who has
> http://nwalsh.com/ | nothing to lose.-- Gracián
>
Received on Friday, 19 September 2008 06:40:39 UTC