p:equals proposal

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 UTC