XML & Web services: Merge XSD documents (XML Schemas) in java program
- Posted by: M eel
- Posted on: August 18 2004 07:48 EDT
I want to develop a webservice that returns a XSD (a string with the content of one XSD file to be more exactly). That webservice gets the XSDs from a directory (or database). Now the tricky part:
The XSD files can include or import other XSD files, but my webservice needs to return the content of 1 working XSD file. So I need code witch can merge a tree of multiple XSD files to one XSD file.
Do you know where I can get this code?
You can't merge two arbitrary XSD's into one (what are you going to do with target namespaces?). Instead you could do:
<xs:import schemaLocation="a.xsd" namespace="http://a"/>
<xs:import schemaLocation="b.xsd" namespace="http://b"/>
Although later form might not be well supported by various buggy platforms.