Hi,

I'm using Castor 1.2 to generate Java code but having problem to change
name of a generated class when using "ref" in the schema file. What am I
supposed to write in the binding file for this situation:

schema file:

<xsd:element name="root" type="root_type/>

<xsd:complexType name="root_type">
  <xsd:sequence>
    <xsd:element ref="foo"/>
  </xsd:sequence>
</xsd:complexType>

<xsd:element name="foo">
  <xsd:complexType>
    <xsd:sequence>
      <xsd:element name="bar" type="xsd:string"/>
    </xsd:sequence>
  </xsd:complexType>
</xsd:element>

...to change the name of the generated class for the "foo" element. I've
tried this:

<elementBinding name="/complexType:root_type/foo">
    <java-class name="FooBar"/>
</elementBinding>

Nope, doesn't work... How about this then:

<complexTypeBinding name="foo">
  <java-class name="FooBar"/>
</complexTypeBinding>

No luck. I've tried all sorts of combinations for the bindingname
without success, the java class "foo" is always generated. What am I
doing wrong here?

There is no problem to change the name to FooBar if I remove the ref and
move the element under the root_type.

TIA

        Ted

Reply via email to