Thanks Radu.
So in order to compare 2 schemas for my use case, I am first building the SchemaTypeSystem for each one and then recursively identifying the commonalities and differences between document types, global attribute types and global types. In order to compare two SchemaTypes, I am recursively comparing their Attributes and Element Properties. In order to compare two SchemaProperties, I am checking if they are simple or complex. If complex I will recursively call compare on their SchemaTypes. For simple properties, I have question-1 below: Question 1: How do I compare 2 simple SchemaProperties? Is their a built-in function or do I need to compare myself their SchemaType, DefaultText, MinOccurs, MaxOccurs etc? Question 2: While doing above comparison, I need to build a common.xsd, which will contain only the common definitions from two schemas. As I identify the common types using above recursive algorithm, how do I write out the common.xsd? I didn't see any call to say remove a property from a SchemaType. Is XmlCursor API the answer to create and write the common.xsd? Is that the only answer? Thanks again. -Ajay ________________________________ From: Radu Preotiuc-Pietro [mailto:[EMAIL PROTECTED] Sent: Thursday, May 17, 2007 12:38 PM To: [email protected] Subject: RE: questions on XMLBeans 1) No. There is no algorithm defined for doing a semantic diff between two Schemas, so we didn't spend the time to implement anything in this area. (as you have seen yourself, you don't even need a diff after all, but something different) But using the SchemaType API you have all you need to implement some custom logic appropriate to your use-case. 2) Yes, XmlBeans fully supports loading and manipulating invalid Schema documents. Radu ________________________________ From: Ajay Aggarwal [mailto:[EMAIL PROTECTED] Sent: Thursday, May 17, 2007 8:12 AM To: [email protected] Subject: RE: questions on XMLBeans Let me further qualify point number 1 below. What I really need to do is compare the two schemas and come up with a 3rd one which contains only the common definitions. ________________________________ From: Ajay Aggarwal [mailto:[EMAIL PROTECTED] Sent: Thursday, May 17, 2007 11:05 AM To: [email protected] Subject: questions on XMLBeans I am evaluating XMLBeans for one of the projects. I have a few questions: 1) Does XML Beans provide any utility/hooks to compare two different schema files? 2) If my XML document deviates slightly from the underlying schema, can I still load it using XMLBeans... some sort of best effort XML to Java mapping? Thanks. 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.

