Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - Check two elements are not deep equal >Thread Next - jaxb vs jaxp for XML validation RE: Check two elements are not deep equalTo: "'Andrew Welch'" <andrew.j.welch@-----.--->, <xmlschema-dev@--.---> Date: 11/28/2007 12:41:00 PM 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> > -----Original Message----- > From: xmlschema-dev-request@w... > [mailto:xmlschema-dev-request@w...] On Behalf Of Andrew Welch > Sent: 28 November 2007 10:57 > To: xmlschema-dev@w... > Subject: Check two elements are not deep equal > > > Is it possible in XML Schema 1.0 to ensure two elements are > not deep equal - the equivalent of this XPath: > > //update[not(deep-equal(old/*, new/*))] > > for this structure: > > <update> > <old> > <data1>some value</data1> > <data2>some other value</data2> > </old> > <new> > <data1>some value</data1> > <data2>some other value</data2> > </new> > </update> > > The <update> element should contain an <old> and a <new> with > at least one value different in the <new>... so in the > example the test should fail as the contents of both are the same. > > > thanks > andrew > From andrew.j.welch@g... Wed Nov 28 12:57:15 2007 Received: from maggie.w3.org ([193.51. | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
