Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - RE: Check two elements are not deep equal [Thread Next] Re: Check two elements are not deep equalTo: "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. | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
