It turned out to be easy to wiggle out of the simplest example. Now I'm struggling with this beast:
~ <xsd:complexType name="text"> ~ <xsd:complexContent mixed="true"> ~ <xsd:restriction base="xsd:anyType"> ~ <xsd:sequence> ~ <xsd:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/> ~ </xsd:sequence> ~ </xsd:restriction> ~ </xsd:complexContent> ~ </xsd:complexType> I haven't given up yet, but I'd be happy if anyone had a fix. Mats | I just bumped into exactly the same bug. | What is the status of this bug? I'm pretty | sure it is a bug, since I just copied the | use of the anyType from section 2.5.3 of the | XSD specification: | | http://www.w3.org/TR/xmlschema-0/ | | It all boils down to the wish of being able to | write empty elements, like this: | | <price currency="EUR" value="423.46"/> | | Mats | | | Castor does not seem to be able to digest | | <xsd:extension base = "xsd:anyType"> | | | | The test schema was generated with TIBCO's TurboXML schema editor, | | so the schema could be illegal. If not, this may be a bug in 0.9.3.19. | | A seemingly similar problem was mentioned in | | http://castor.exolab.org/list-archive/msg16749.html | | | | schema example: | | | | <?xml version = "1.0" encoding = "UTF-8"?> | | <xsd:schema xmlns = "uri://foo.bar.com/anyTypeExample" | | targetNamespace = "uri://foo.bar.com/anyTypeExample" | | xmlns:xsd = "http://www.w3.org/2001/XMLSchema"> | | | | <xsd:element name = "someElement"> | | <xsd:complexType> | | | <xsd:complexContent> | | | <xsd:extension base = "xsd:anyType"> | | | <xsd:attribute name = "type" use = | | "optional" type = "xsd:NMTOKEN"/> | | | </xsd:extension> | | | </xsd:complexContent> | | </xsd:complexType> | | </xsd:element> | | </xsd:schema> | | | | | | error: | | | | [CastorXMLSourceGenerator] running | org.exolab.castor.builder.SourceGenerator | | -i xml/anyTypeExample.xsd -package com.bar.foo -dest build | | [CastorXMLSourceGenerator] java.lang.IllegalArgumentException: | | getSimpleType: the simple type 'anyType' is not a built-in type as | defined | | in XML Schema specification. | | [CastorXMLSourceGenerator] at | | org.exolab.castor.xml.schema.Schema.getSimpleType(Unknown Source) | | [CastorXMLSourceGenerator] at | | org.exolab.castor.xml.schema.Schema.getType(Unknown Source) | | [CastorXMLSourceGenerator] at | | org.exolab.castor.xml.schema.reader.ExtensionUnmarshaller.<init>(Unknown | | Source) | | [CastorXMLSourceGenerator] at | | | org.exolab.castor.xml.schema.reader.ComplexContentUnmarshaller.startElement( | | | Unknown Source) | | [CastorXMLSourceGenerator] at | | | org.exolab.castor.xml.schema.reader.ComplexTypeUnmarshaller.startElement(Unk | | | nown Source) | | [CastorXMLSourceGenerator] at | | | org.exolab.castor.xml.schema.reader.ElementUnmarshaller.startElement(Unknown | | | Source) | | [CastorXMLSourceGenerator] at | | | org.exolab.castor.xml.schema.reader.SchemaUnmarshaller.startElement(Unknown | | Source) | | [CastorXMLSourceGenerator] at | | | org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXParser.j | | | ava:391) | | [CastorXMLSourceGenerator] at | | | org.apache.xerces.impl.XMLNamespaceBinder.startElement(XMLNamespaceBinder.ja | | | va:571) | | [CastorXMLSourceGenerator] at | | | org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java | | | :792) | | [CastorXMLSourceGenerator] at | | | org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDo | | | cumentFragmentScannerImpl.java:743) | | [CastorXMLSourceGenerator] at | | | org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatc | | | her.dispatch(XMLDocumentFragmentScannerImpl.java:1440) | | [CastorXMLSourceGenerator] at | | | org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocume | | | ntFragmentScannerImpl.java:331) | | [CastorXMLSourceGenerator] at | | | org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserCo | | | nfiguration.java:512) | | [CastorXMLSourceGenerator] at | | | org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserCo | | | nfiguration.java:559) | | [CastorXMLSourceGenerator] at | | org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:148) | | [CastorXMLSourceGenerator] at | | | org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:112 | | | 4) | | [CastorXMLSourceGenerator] at | | org.exolab.castor.builder.SourceGenerator.generateSource(Unknown Source) | | [CastorXMLSourceGenerator] at | | org.exolab.castor.builder.SourceGenerator.generateSource(Unknown Source) | | [CastorXMLSourceGenerator] at | | org.exolab.castor.builder.SourceGenerator.main(Unknown Source) | | [CastorXMLSourceGenerator] at java.lang.reflect.Method.invoke(Native | | Method) | | | | | | | | | | | ------------------------------------------------------------------------------ | | | This message is intended only for the personal and confidential use of | the designated recipient(s) | named above. If you are not the intended recipient of this message you | are hereby notified that any | review, dissemination, distribution or copying of this message is | strictly prohibited. This | communication is for information purposes only and should not be | regarded as an offer to sell or as | a solicitation of an offer to buy any financial product, an official | confirmation of any | transaction, or as an official statement of Lehman Brothers. Email | transmission cannot be | guaranteed to be secure or error-free. Therefore, we do not represent | that this information is | complete or accurate and it should not be relied upon as such. All | information is subject to change | without notice. | | | | ----------------------------------------------------------- | | If you wish to unsubscribe from this mailing, send mail to | | [EMAIL PROTECTED] with a subject of: | | unsubscribe castor-dev | | | | | | ----------------------------------------------------------- If you wish | to unsubscribe from this mailing, send mail to | [EMAIL PROTECTED] with a subject of: | unsubscribe castor-dev | | ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
