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

p:equals proposal

From: Innovimax SARL <innovimax@gmail.com>
Date: Sat, 26 May 2007 10:01:03 +0200
Message-ID: <546c6c1c0705260101td2c9b9bm7106402b5538c8a8@mail.gmail.com>
To: "XProc WG" <public-xml-processing-model-wg@w3.org>

Dear,

Here is a simple proposal

We have p:identity to output the identity as its output

In some case, I need to make comparison between outputs to know if
they are equals

Here is the proposal

== document version ==
<p:equal>
 <p:input port="source">
 <p:input port="compare-to">
 <p:output port="result">
 <p:output port="alternate"/>
 <p:export-option name="is-equal"/><!-- type boolean() -->
 <p:export-option name="xpath-position"/><!-- type string() -->
</p:equal>

If would do a sequential node by node comparaison. It would make
available to !result the content of !source and to !alternate the
content of !compare-to
At the end of the process, it would make available the value option
"$is-equal" binded to true() or false()
And it would make available the first position in document order where
the document differs as a simple xpath (of the form
doc[1]/div[2]/p[3]/a[1])

== sequence version ==
(we need only one of those)

<p:equal>
 <p:input port="source" sequence="yes">
 <p:input port="compare-to" sequence="yes">
 <p:output port="result" sequence="yes">
 <p:output port="alternate" sequence="yes"/>
 <p:export-option name="is-equal"/><!-- type boolean() -->
 <p:export-option name="xpath-position"/><!-- type string() -->
 <p:export-option name="document-position"/><!-- type number() -->
</p:equal>

the same as above but with sequence and make also the
$document-position available as the number where the first difference
appears with the xpath positon in this document

Mohamed
-- 
Innovimax SARL
Consulting, Training & XML Development
9, impasse des Orteaux
75020 Paris
Tel : +33 8 72 475787
Fax : +33 1 4356 1746
http://www.innovimax.fr
RCS Paris 488.018.631
SARL au capital de 10.000 
Received on Saturday, 26 May 2007 08:01:28 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:21:52 GMT