Re: Optimizing a schema.

Casey,

I had trouble reading your example until I beautified it with my Pretty Diff tool.  It is also written in JavaScript, so can likely consume it into your application.  Just choose the markup and beautify options.

http://prettydiff.com/

What you are going to have to do is test for singleton elements that are absent any attributes and empty elements.  Once those elements are detected you will need to remove them from the output.  The test needs to be recursive as removing elements will result in empty parents.  I am sure this can be done with ease even using JavaScript as I have written similar code before.

Austin Cheney

Received on Wednesday, 21 July 2010 22:30:18 UTC