users@jaxb.java.net

Parsing xml files that have a Microsoft schema

From: Timothy Astle <tastle_at_hotmail.com>
Date: Tue, 17 Nov 2009 12:04:14 -0400

When I run xjc on the test.xsd below, I get the following errors:


[ERROR] s4s-elt-schema-ns: The namespace of element 'Schema' must be from the schema namespace, 'http://www.w3.org/2001/XMLSchema'.
  line 2 of file:/D:/Temp/jaxb-ri-20061211/bin/test/test.xsd

[ERROR] s4s-elt-invalid: Element 'Schema' is not a valid element in a schema document.
  line 2 of file:/D:/Temp/jaxb-ri-20061211/bin/test/test.xsd

[ERROR] schema_reference.4: Failed to read schema document 'file:/D:/Temp/jaxb-ri-20061211/bin/test/test.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
  line 2 of file:/D:/Temp/jaxb-ri-20061211/bin/test/test.xsd



test.xsd


<Schema xmlns='urn:schemas-microsoft-com:xml-data'

  xmlns:dt='urn:schemas-microsoft-com:datatypes'>

 <ElementType name='test' content='textOnly' dt:type='ui4' dt:minLength='1'/>
</Schema>




I think that the SchemaFactory just cannot handle the Microsoft schema namespaces. Is this correct? If so, what is a good workaround for this?
                                               
_________________________________________________________________
Windows Live: Keep your friends up to date with what you do online.
http://go.microsoft.com/?linkid=9691815