tags:

views:

463

answers:

2

I need to take any given valid XML schema (XSD) and denormalize it to a simple form containing no refs, no includes, etc. All simple type definitions should be inline, such that when looking at any given element, all declarations are visible without performing another lookup.

I've found some tools that have this built-in, but I need to do it "on the fly." Platform of choice is Java, but I'd be willing to port the code from another language if necessary. I just really don't want to reinvent the wheel here. Searching for OSS libraries from Apache/etc have yielded nothing. The closest I've found is XSOM which supports traversing a schema as an object model, but you still have to handle every possible form that a schema could take to represent a given structure.

The output doesn't have to be actual XML, as it will actually be used in a object model in its final form.

+1  A: 

You might find XSD4J helpful:

http://dynvocation.selfip.net/xsd4j/

Alex Miller
+1  A: 

The EMF XSD model may be helpful:

http://www.eclipse.org/modeling/mdt/?project=xsd

Alex Miller