When trying to generate source for the w3c schema:  xmldsig-core-schema I
get the following error:

Exception in thread "main" java.lang.IllegalArgumentException: duplicate
name found: _anyObject
        at org.exolab.javasource.JClass.addField(JClass.java:242)
        at
org.exolab.castor.builder.FieldInfo.createJavaField(FieldInfo.java:157)
        at
org.exolab.castor.builder.SourceFactory.handleField(SourceFactory.java:1289)
        at
org.exolab.castor.builder.SourceFactory.processContentModel(SourceFactory.ja
va:1390)
        at
org.exolab.castor.builder.SourceFactory.processContentModel(SourceFactory.ja
va:1403)
        at
org.exolab.castor.builder.SourceFactory.processComplexType(SourceFactory.jav
a:1274)
        at
org.exolab.castor.builder.SourceFactory.createSourceCode(SourceFactory.java:
391)
        at
org.exolab.castor.builder.SourceGenerator.processComplexType(SourceGenerator
.java:758)
        at
org.exolab.castor.builder.SourceGenerator.createClasses(SourceGenerator.java
:728)
        at
org.exolab.castor.builder.SourceGenerator.createClasses(SourceGenerator.java
:679)
        at
org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.jav
a:323)
        at
org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.jav
a:381)
        at
org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.jav
a:410)
        at
org.exolab.castor.builder.SourceGenerator.main(SourceGenerator.java:637)

I am up to date with CVS.  The offical schema instance can be found at:
http://www.w3.org/TR/2001/PR-xmldsig-core-20010820/xmldsig-core-schema.xsd

I stepped through the Castor code and found that the offending element is as
follows:
<element name="PGPData" type="ds:PGPDataType"/>  
<complexType name="PGPDataType">  
        <choice> 
                <sequence> 
                        <element name="PGPKeyID" type="base64Binary"/>  
                        <element name="PGPKeyPacket" type="base64Binary"
minOccurs="0"/> 
                        <any namespace="##other" processContents="lax"
minOccurs="0" maxOccurs="unbounded"/>
                </sequence> 
                <sequence>
                        <element name="PGPKeyPacket" type="base64Binary"/> 
                        <any namespace="##other" processContents="lax"
minOccurs="0" maxOccurs="unbounded"/> 
                </sequence>
        </choice> 
</complexType>

Castor is choking when it hits the second <any namespace="##other" ... as if
its trying to create it again and then throwing the exception.

I had to alter the schema as a work around but I won't be able to keep this
workaround for very long.  Any help would be appreciated.

Thank you,

Joann Kent

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to