The JavaDoc for .valueEquals() is fairly detailed but forgets to mention one thing: that .valueEquals() is only implemented for simple type values.
Actually, Schema-aware comparison is something that a lot of people find valuable and XmlBeans has all the foundation work done to support something like that, unfortunately we weren't able to find an interested person that could contribute the code to do it. This is my way of saying basically that this would be a great project for someone who is looking to get involved in XmlBeans and in Apache and open-source in general. Radu -----Original Message----- From: Bailey, Brian P [mailto:[EMAIL PROTECTED] Sent: Thursday, August 17, 2006 3:35 PM To: [email protected] Subject: How to use XmlObject.valueEquals Hi, I'm using xmlbeans 2.1.0 and have a question about comparing XmlObjects for equivalency. I have the following schema: <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://myself.com/data" targetNamespace="http://myself.com/data"> <complexType name="location2DType"> <sequence> <element name="latitude" type="double"/> <element name="longitude" type="double"/> </sequence> </complexType> <element name="Location2D" type="tns:location2DType"/> </schema> I would like to compare two documents based on this schema and see if they are equivalent (ignoring element prefixes, attribute ordering, etc.). I thought I might use XmlObject.valueEquals(), but that doesn't seem to work. For example, when running the following code, I see "valueEquals: true" even though the latitude value is different: Location2DDocument doc1 = Location2DDocument.Factory.newInstance(); doc1.addNewLocation2D(); doc1.getLocation2D().setLatitude(34.2); doc1.getLocation2D().setLongitude(84.8); Location2DDocument doc2 = Location2DDocument.Factory.newInstance(); doc2.addNewLocation2D(); doc2.getLocation2D().setLatitude(95.2); doc2.getLocation2D().setLongitude(84.8); System.out.println("valueEquals: " + doc1.valueEquals(doc2)); What should I use to compare two xml beans for equivalency? --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _______________________________________________________________________ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

