How could one make a root element to wrap all the complexType elements? I tried the followings and it did NOT work. Thank you ==== <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0"> <xs:element name="root"> <--- NOT working <xs:complexType name="a"> .... </xs:complexType> <xs:complexType name="b"> .... </xs:complexType> <xs:complexType name="c"> .... </xs:complexType> </xs:element> <--- NOT working </xs:schema>
Your sample code puzzles me. Are you looking to use Java to create a DOM document with a root element of "xs:schema" which in turn has a single child element having a local name "root", and then create child elements for "root" in the "xs" namespace having a local name of "complexType",
are you trying to transform one XML document to another using XSLT giving these results?
But that doesn't work if I try to make a root element encompassing all those elements. For example, please make a root element out of the following: === <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0"> <xs:complexType name="a" abstract="true"> <xs:sequence> ... </xs:sequence> </xs:complexType>
Thanks for your patience. Is it possible to put a root element in the xsd file (instead in the xml file) in your example? I am using xmlspy to generate the xml file from the xsd file and it complains of no root element. What I have is more than 10 complexType elements, including those containing 'extension'. I still have problem putting a root element in the xsd... at this point, I am not so sure it's possible or not. Thanks much. [ September 27, 2006: Message edited by: thomas silver ]