tags:

views:

5

answers:

0

We're trying to parse an XSD and build a property sheet out of that (using XML Beans).

The code is as following:

   XmlObject xmlObj = XmlObject.Factory.parse( schema );
   sts = XmlBeans.compileXsd(new XmlObject[] { xmlObj },  XmlBeans.getBuiltinTypeSystem(), null);

Call to compileXsd throws the an exception with message: The 0th supplied input is not a schema document: its type is N=

Our schema looks like this:

  <schema xmlns:com.co.workflow="com.co.workflow" xmlns:org.data="org.data" targetNamespace="org.activity" version="1.0">
  <complexType class="org.activity.ExecuteCommand" name="executeCommand">
    <complexContent>
    ...
    ...

Stack trace:

The 0th supplied input is not a schema document: its type is N=
    at org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler.compile(SchemaTypeSystemCompiler.java:211)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.xmlbeans.XmlBeans.compileXmlBeans(XmlBeans.java:667)
    at org.apache.xmlbeans.XmlBeans.compileXsd(XmlBeans.java:553)
        ......