Re: Optimizing a schema.

"Cheney, Edward A SSG RES USAR USARC" <[email protected]>
Newsgroups gmane.text.xml.schema.devel
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.