I just tested this against the CVS, it appears that it's a bug. As a
workaround it does work if you fully qualify your type:

for example:

<xsd:schema targetNamespace="my-namespace"
            xmlns:my="my-namespace" ...>

<xsd:attribute name="foo" type="my:ID"/>

</xsd:schema>


I'm currently working on the Schema Object Model so I will fix this
properly in the CVS shortly.

Thanks,

--Keith

A Yang wrote:
> 
> Hi,
> 
> Can anyone tell me what the following exception means?
> I'm trying to run sourcegen off of an existing XML
> Schema file.
> 
> Exception in thread "main"
> java.lang.IllegalArgumentException: getSimpleType: th
> e simple type 'ID' has not been declared in XML Schema
> namespace.
>         at
> org.exolab.castor.xml.schema.Schema.getSimpleType(Schema.java:677)
> .....
> 
> I don't know why Castor can't find the simple type as
> it is defined as follows:
> 
> <xsd:simpleType name="ID">
>   <xsd:restriction base="xsd:ID"/>
> </xsd:simpleType>
> 
> It is being used in a complexType definition:
> 
> <xsd:complexType>
>   <xsd:simpleContent>
>     <xsd:extension base="C-64">
>     <xsd:attribute name="id" use="optional" type="ID">
>   ...
> 
> Would defining it as a simpleType not bring it into my
> default target namespace?
> 
> Thanks,
> Andy
> 
> ______________________________________________________
> Send your holiday cheer with http://greetings.yahoo.ca
> 
> -----------------------------------------------------------
> 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

Reply via email to