If I have a document that contains an embedded XML Schema, how can I
change the SchemaType of the <xs:schema> element from an element
of the containing document type? One way to do it would be to convert
it to a string and compiling it, but that seems like a waste.
When I attempt to execute this:
SchemaTypeSystem sts = XmlBeans.compileXsd(
new XmlObject[] { schemaObject },
XmlBeans.getBuiltinTypeSystem(),
compileOptions);
I get the following error:
org.apache.xmlbeans.XmlException: Thread main: The 0th supplied input is not a
schema document: its type is
E=configSchema|t=metadatat...@http://lett.com/ns/netconf/server/meta/1.0
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)
at
com.lett.netconf.server.db.ManagedDevice$Metadata$Schema.compile(ManagedDevice.java:781)
at
com.lett.netconf.server.db.ManagedDevice$Metadata$Schema.<init>(ManagedDevice.java:658)
at
com.lett.netconf.server.db.ManagedDevice$Metadata.<init>(ManagedDevice.java:416)
at
com.lett.netconf.server.db.ConfigServerDevice.<init>(ConfigServerDevice.java:105)
at com.lett.netconf.server.db.Storage.<init>(Storage.java:173)
at com.lett.netconf.server.db.Storage.<init>(Storage.java:123)
at
com.lett.netconf.server.NetconfServerDaemon.<clinit>(NetconfServerDaemon.java:183)
schemaObject is an XmlObject that is a document with the root element
<xs:schema>. It was
extracted from the configSchema element of a document of type metadataType. The
configSchema
element has a single child element of type <xs:any>, which is the schema.
- Andy
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]