You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Andy Putnins <pu...@lett.com> on 2009/03/05 01:29:36 UTC
STS.parse() produces unexpected type
When I parse an instance doc with the SchemaTypeSystem.parse() method,
I end up with an object of class
"org.apache.xmlbeans.impl.values.XmlComplexContentImpl"
instead of the expected "ConfigServerConfigDocument". The STS is the union
of the built-in (and scomp-compiled, I assume) types and the subject schema.
It looks to me like it's not recognizing the root element, even though
the instance object succesfully passes validation - what am I doing wrong?
- Andy
XmlObject schemaObject = schemaDocAsXmlObject.selectChildren(new QName("http://www.w3.org/2001/XMLSchema", "schema"))[0];
SchemaTypeSystem sts = XmlBeans.compileXsd(new XmlObject[] { schemaObject }, XmlBeans.getBuiltinTypeSystem(), compileOptions);
XmlObject xml = configSchema.sts.parse((String)doc, configSchema.docSchemaType, options);
Schema has:
<xml-fragment targetNamespace="http://lett.com/ns/netconf/server/config/1.0" ... >
<xs:element name="config-serverConfig" type="ncsc:configServerConfigType"/>
...
</xml-fragment>
instance doc has:
<config-serverConfig xmlns="http://lett.com/ns/netconf/server/config/1.0">
<daemonConfig/>
...
</config-serverConfig>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org