Hi Zia,
Which validator are you using to ensure
your schema is W3C compliant? This issue has been discussed in the past in the
castor-dev list. Please search the archive for a proper pointer to the XML
schema spec but I think Castor is right: you cannot restrict a restriction.
Thanks,
Arnaud
-----Original Message-----
From: Zia Khan [mailto:[EMAIL PROTECTED]
Sent: Saturday, July 05, 2003 7:18
AM
To: [EMAIL PROTECTED]
Subject: [castor-dev] Source
Generation: Restricting a restricted Complex Type?
I am attaching a W3C compliant schema which restricts a
restricted complex type. When we run the SourceGenerator on this schema
it is throwing a IllegalStateException. Why castor does not allow a complex
type to be restriction of a restriction?
C:\xml-schemas>java
org.exolab.castor.builder.SourceGenerator -types j2 -i juicers.xsd -package
juicers
Exception in thread "main" java.lang.IllegalStateException:
extend1ContentA complex type cannot be a restriction of a restriction.
at
org.exolab.castor.xml.schema.reader.ComplexContentRestrictionUnmarshaller.<init>(ComplexContentRestrictionUnmarshaller.java:146)
at
org.exolab.castor.xml.schema.reader.ComplexContentUnmarshaller.startElement(ComplexContentUnmarshaller.java:196)
at
org.exolab.castor.xml.schema.reader.ComplexTypeUnmarshaller.startElement(ComplexTypeUnmarshaller.java:237)
at
org.exolab.castor.xml.schema.reader.SchemaUnmarshaller.startElement(SchemaUnmarshaller.java:371)
at
org.exolab.castor.xml.schema.reader.Sax2ComponentReader.startElement(Sax2ComponentReader.java:253)
at
org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at
org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
at
org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at
org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at
org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:518)
at
org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:571)
at
org.exolab.castor.builder.SourceGenerator.main(SourceGenerator.java:1126)
|