membrane/soa-model — pull request #11 by g1l3sp (2012-12-10 02:07:43+00:00)
Title: AnyDiffGenerator

I have written and would like to contribute an AnyDiffGenerator. In the Kuali Rice project we use 'any' elements extensively in the schemas for our data transfer objects to keep them flexible for future versions that might introduce new data elements. There are a few points for review since I only occasionally have to work with XSDs and am not an expert.

* I consider any's processContents and namespace attributes completely separately. I'm not sure if that is correct, or if some combinatorial considerations should be made.
* I added more detailed comparison to ElementDiffGenerator.compareMinMaxOccurs(...) that I believe is generalizable to other elements. I rely on this comparison in the AnyDiffGenerator. It should probably be double-checked to make sure that my assumptions are correct.
* I added 'breaks' and 'safe' values to a couple of the Differences generated in SequenceDiffGenerator so that safe() and breaks() could be recursively evaluated correctly. I'm not sure if those changes are valid or not, but my assumptions are that (safe != breaks), and breaks() should be true if any child Difference has (breaks == true).
* I have not considered or handled the case where an existing element has been replaced with an 'any'. This technically could be non-breaking depending on the values of the 'any' element's attributes, but additional work would be needed to consider that situation. Perhaps that work needs to be done before this patch could be accepted?

Thank you for your time and for your open source work!