Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Check two elements are not deep equal

From: "Andrew Welch" <andrew.j.welch@-----.--->
To: "Michael Kay" <mike@--------.--->
Date: 11/28/2007 12:57:00 PM
On 28/11/2007, Michael Kay <mike@s...> wrote:
> In 1.1 - as implemented by Saxon 9.0 - you can do
>
> <xs:assert test="not(deep-equal(old, new))"/>
>
> But if it's as simple as this I think you can also do it in 1.0:
>
> * define that both old and new exist in the usual way
>
> * define at the update level
>
> <xs:unique>
>   <xs:selector xpath="*"/>
>   <xs:field xpath="data1"/>
>   <xs:field xpath="data2"/>
> </xs:unique>

Fantastic - that's brilliant thanks... there are 20 elements is the
real code so the list is a lot longer but it does the job.

One small issue which I can happily live with - two of the elements
are optional (say data3 and data4), and when they don't occur in the
XML I get this error (from Xerces):

org.xml.sax.SAXParseException: Not enough values specified for
<unique> identity constraint specified for element "update".

I've removed the elements from the field list in the unique
constraint, which is fine as they're rare, but if its straightforward
to handle this situation... any ideas?

thanks

From ceek63@y... Thu Nov 29 02:05:04 2007
Received: from aji.w3.org ([133.


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent