xml - XSD Validation Error : cos-all-limited.1.2: An 'all' model group must appear in a particle with -
i have , xsd gives following error during schema generation.
org.xml.sax.saxparseexception; systemid: file:/d:/basil/projects/myproducts.xsd; linenumber: 577; columnnumber: 50; cos-all-limited.1.2: 'all' model group must appear in particle '{'min occurs'}' = '{'max occurs'}' = 1, , particle must part of pair constitutes '{'content type'}' of complex type definition. @ com.sun.org.apache.xerces.internal.util.errorhandlerwrapper.createsaxparseexception(errorhandlerwrapper.java:198) @ com.sun.org.apache.xerces.internal.util.errorhandlerwrapper.error(errorhandlerwrapper.java:134) @ com.sun.org.apache.xerces.internal.impl.xmlerrorreporter.reporterror(xmlerrorreporter.java:437) @ com.sun.org.apache.xerces.internal.impl.xs.traversers.xsdhandler.reportschemaerr(xsdhandler.java:4124) @ com.sun.org.apache.xerces.internal.impl.xs.traversers.xsdhandler.reportschemaerror(xsdhandler.java:4107) @ com.sun.org.apache.xerces.internal.impl.xs.xmlschemaloader.loadschema(xmlschemaloader.java:588) @ com.sun.org.apache.xerces.internal.impl.xs.xmlschemaloader.loadgrammar(xmlschemaloader.java:555) @ com.sun.org.apache.xerces.internal.impl.xs.xmlschemaloader.loadgrammar(xmlschemaloader.java:521) @ com.sun.org.apache.xerces.internal.jaxp.validation.xmlschemafactory.newschema(xmlschemafactory.java:240) @ com.sun.tools.xjc.reader.xmlschema.parser.schemaconstraintchecker.check(schemaconstraintchecker.java:101) @ com.sun.tools.xjc.modelloader.loadxmlschema(modelloader.java:357) @ com.sun.tools.xjc.modelloader.load(modelloader.java:167) @ com.sun.tools.xjc.modelloader.load(modelloader.java:113) @ com.sun.tools.xjc.driver.run(driver.java:313) @ org.codehaus.mojo.jaxb2.abstractxjcmojo.execute(abstractxjcmojo.java:298) @ org.apache.maven.plugin.defaultpluginmanager.executemojo(defaultpluginmanager.java:490)
the relevant xsd pasted below. i'm unable understand actual error is. error on third line end. please help.
<xs:group name="prodvar"> <xs:all> <xs:element name="prodvar" minoccurs="0" maxoccurs="1"> <xs:complextype> <xs:sequence> <xs:element name="varname" type="xs:string" minoccurs="0" maxoccurs="unbounded" /> <xs:element ref="skulist" /> <xs:element name="vstory" type="xs:string" minoccurs="0" /> <xs:element ref="attlist" /> </xs:sequence> </xs:complextype> </xs:element> <xs:element name="colorswatchlist" minoccurs="0" maxoccurs="1"> <xs:complextype> <xs:sequence minoccurs="1" maxoccurs="unbounded"> <xs:element name="colorswatch" minoccurs="0" maxoccurs="unbounded"> <xs:complextype> <xs:sequence> <xs:element name="swatchname" type="xs:string" minoccurs="0" /> <xs:element name="swatchheight" type="xs:string" minoccurs="0" /> <xs:element name="swatchwidth" type="xs:string" minoccurs="0" /> <xs:element name="colorname" type="xs:string" minoccurs="0" /> <xs:element name="mainimageheight" type="xs:string" minoccurs="0" /> <xs:element name="mainimagewidth" type="xs:string" minoccurs="0" /> <xs:element name="mainimagename" type="xs:string" minoccurs="0" /> </xs:sequence> </xs:complextype> </xs:element> </xs:sequence> </xs:complextype> </xs:element> </xs:all> </xs:group> <!--lot of other stuff --> <xs:element name="prodvarlist" minoccurs="0" maxoccurs="1"> <xs:complextype> <!-- error here --> <xs:group ref="prodvar" minoccurs="0" maxoccurs="unbounded" /> </xs:complextype> </xs:element>
just rid of maxoccurs="unbounded"
in <xs:group ref="prodvar" minoccurs="0" maxoccurs="unbounded" />
in xsd 1.0, xs:all
cannot repeat (here indirectly, may 'nice try!'), nor particle under xs:all
, nor can nested under other compositor.
Comments
Post a Comment