BUG - Nuxeo Studio generating syntactically invalid schema for nested complex types
Hello, I'm noticing that if you create a schema in Nuxeo Studio with the advanced config option “allow nested complex types”, then actually create nested complex types, the XSD that gets generated is syntactically incorrect. Here's a snippet of the XSD that gets generated:
<xs:complexType name="glanswer_answersType">
<xs:sequence>
<xs:element name="answerContent" type="xs:string"/>
<xs:element name="properties" type="nxs:glanswer_propertiesListType"/>
<xs:complexType name="glanswer_propertiesListType">
<xs:sequence>
<xs:element name="item" type="nxs:glanswer_propertiesType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="glanswer_propertiesType">
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="value" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:sequence>
Notice the <xs:complexType>
nested which XSD doesn't allow. As it stands now, i have to manually edit the schema as a workaround.
I'm observing this behavior on Nuxeo Studio 2.15 on my DM 5.8-HF01
thanks
Hi,
The corresponding bug (https://jira.nuxeo.com/browse/NXS-1851) is now fixed, thanks again for the report and the steps to reproduce.
This isn't really a full answer, but it's an acceptable workaround. I still think the underlying issue is a bug in studio.
After I “Update” from “Update Center” to pull down the latest studio stuff, I do the following:
- edit offending schema that get unpacked from the studio bundle in nxserver/schemas directory, fix busted syntax
- in studio, delete the GUI-created schemas
- create new schemas with the same name/prefix as the originals, but use the Advanced option to “Import” an XSD
- Upload the edited schema
When you next run the update, Nuxeo DM reinitializes correctly, and no errors processing the schema.
Could you please provide detailed steps to reproduce the issue?
Thanks
Switch over to Nuxeo DM
In Nuxeo DM logs, i see this: 2013-11-22 07:22:19,720 ERROR [http-bio-0.0.0.0-8080-exec-5] [org.nuxeo.ecm.core.schema.XSDLoader] FatalError: Unexpected <xs:complexType> appears at line 44 column 52 2013-11-22 07:22:19,721 ERROR [http-bio-0.0.0.0-8080-exec-5] [org.nuxeo.ecm.core.schema.SchemaManagerImpl] org.xml.sax.SAXParseException; systemId: file:/Users/rtrotter/Downloads/nuxeo-cap-5.8-tomcat/nxserver//schemas/bugtest.xsd; lineNumber: 44; columnNumber: 52; Unexpected <xs:complexType> appears at line 44 column 52
For completeness, here are lines 35 through 55 of bugtest.xsd as it got generated from studio:
<xs:element name="nest1" type="nxs:bugtest_nest1ListType"/> <xs:complexType name="bugtest_nest1ListType">
</xs:complexType> <xs:complexType name="bugtest_nest1Type">
</xs:complexType>
I've created https://jira.nuxeo.com/browse/NXS-1851 if you'd like to follow the resolution.
You should be able to see the issue now