I am having the same problem with imported simpleTypes
as Pratibha (see his email repeated below) -
unfortunately, I was unable to find a response to his
post.
In my case, the schema I am importing contains a
simpleType defined as follows:
<simpleType name="DataEntity">
<restriction base="long">
<minInclusive value="10" />
</restriction>
</simpleType>
I then import the schema, set the namespace for it
("xyz") and declare an element of type DataEntity as
follows:
<element name="CustomerID"
type="xyz:DataEntity"></element>
When I run the Castor source generator, it complains
that "the simple type 'DataEntity' is not a built-in
type as defined in XML Schema specification".
(When I define simpleType DataEntity within the same
schema as is being generated - i.e. no import - the
problem does not occur. But this workaround is
impractical).
I appreciate that the Source Generator does not
generate classes for simpleTypes - so what exactly
does it need here? Why doesn't it realise that my
DataEntity type is derived from a built-in long type?
Am I doing something wrong, or doesn't Castor handle
simpleTypes defined in imported schema?
Any help you can give me would be appreciated, because
this problem is quickly turning into a show-stopper.
Thanks,
David.
-------------------------------------------------------
Date: Thu, 30 May 2002 13:10:02 -0700
From: [EMAIL PROTECTED] (Pratibha Gupta)
Subject: Referencing SimpleType through import
--------------------------------------------------------------------------------
Hi,
I have a simpleType defined in a foo.xsd file.
<xsd:schema targetNamespace="http://www.xyz.com/foo";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>
<simpleType name="IDType">
<restriction base="string"/>
</simpleType>
When I run Source Generator on this file, no classes
are generated for
this simple type.
Now I have another foo1.xsd file which uses this
simple type. I have
imported the first xsd into this xsd.
<xsd:schema targetNamespace="http://www.xyz.com/foo1";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:foo="http://www.xyz.com/foo";
>
<xsd:import namespace="http://www.xyz.com/foo";;
schemaLocation="foo.xsd" />
<complexType name="someType" abstract="true">
<attribute name="UserID" type="foo:IDType"
use="required"/>
</complexType>
When I run SourceGenerator on this file, I get an
error message, saying
that
Exception in thread "main"
java.lang.IllegalArgumentException:
getSimpleType:
the simple type 'IDType' is not a built-in type as
defined in XML Schema
specification.
How can I convince SourceGenerator to generate a class
for the this
SimpleType?
Thanks,
Pratibha
__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev