Hi Liu,

This is indeed the same issue.

Arnaud

-> -----Original Message-----
-> From: Liu, Fengxian [mailto:[EMAIL PROTECTED]]
-> Sent: Thursday, November 29, 2001 9:53 AM
-> To: [EMAIL PROTECTED]
-> Subject: Re: [castor-dev] Duplicate type classes for attribute
-> definitions
-> 
-> 
-> Hi Keith:
->   I had a schema like:
-> 
-> <?xml version="1.0" encoding="UTF-8"?>
-> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
->      <xsd:complexType name="RouteOrArea">
->              <xsd:choice>
->                      <xsd:element name="route" type="xsd:string"/>
->                      <xsd:element name="area" type="xsd:string"/>
->              </xsd:choice>
->      </xsd:complexType>
->      <xsd:complexType name="LocationReference">
->              <xsd:choice>
->                      <xsd:element name="geometry" type="xsd:string"/>
->                      <xsd:element name="geocoordinate"
-> type="xsd:string"/>
->              </xsd:choice>
->      </xsd:complexType>      
->      <xsd:complexType name="NodeAdditionalInformation">
->              <xsd:sequence>
->                      <xsd:element name="location"
-> type="LocationReference"/>
->                      <xsd:element name="node-Name" type="xsd:string"
-> minOccurs="0"/>
->              </xsd:sequence>
->      </xsd:complexType>
->      <xsd:complexType name="TriggerSetting">
->              <xsd:sequence>
->                      <xsd:element name="location" type="RouteOrArea"/>
->                      <xsd:element name="trigger-Event"
-> type="xsd:string"/>
->              </xsd:sequence>
->      </xsd:complexType>  
-> </xsd:schema>
-> 
->   Since both the element "NodeAdditionalInformation" and "TriggerSetting"
-> have subitems named "location", both of the subitems "location" 
-> will try to
-> generate the class "Location" derived from either "RouteOrArea" or
-> "LocationReference". 
-> 
->   Is that the same issue as for the attribute definition which has same
-> names within different scope.?
-> 
->   Thank you very much.
-> 
->   Frank
-> 
-> -----Original Message-----
-> From: Keith Visco [mailto:[EMAIL PROTECTED]]
-> Sent: Wednesday, November 28, 2001 4:28 PM
-> To: [EMAIL PROTECTED]
-> Subject: Re: [castor-dev] Duplicate type classes for attribute
-> definitions
-> 
-> 
-> 
-> Hi Frank,
-> 
-> This is a known Issue...we haven't solved it yet, but it's been
-> discussed a few times on the mailing list in the past.
-> 
-> We'll probably have to go up the tree and also use the element name in
-> the class name: 
-> 
-> So instead of the conflicting "ValueType", we'd have:
-> 
-> "SideValueType" and "HorizontalDatumValueType".
-> 
-> Another solution will be to use a binding file in conjuction with the
-> source generator, so that one could specify the class name for the
-> simpleType. The binding file support hasn't been checked into the CVS
-> yet, but I think Arnaud has it working, so it shouldn't be too long now
-> for that.
-> 
-> We'll try to fix it soon.
-> 
-> Sorry for the inconvenience.
-> 
-> Thanks,
-> 
-> --Keith
-> 
-> 
-> "Liu, Fengxian" wrote:
-> > 
-> > Hi -
-> >   I came across a problem for attribute names when I tried to 
-> generate the
-> > source code from a schema like this:
-> >  <xsd:element name="side">
-> >         <xsd:complexType>
-> >                 <xsd:sequence/>
-> >                 <xsd:attribute name="value" use="required">
-> >                         <xsd:simpleType>
-> >                                 <xsd:restriction base="xsd:NMTOKEN">
-> >                                         <xsd:enumeration 
-> value="right"/>
-> >                                         <xsd:enumeration value="left"/>
-> >                                 </xsd:restriction>
-> >                         </xsd:simpleType>
-> >                 </xsd:attribute>
-> >         </xsd:complexType>
-> > </xsd:element>
-> > <xsd:element name="horizontalDatum">
-> >         <xsd:complexType>
-> >                 <xsd:sequence/>
-> >                 <xsd:attribute name="value">
-> >                         <xsd:simpleType>
-> >                                 <xsd:restriction base="xsd:NMTOKEN">
-> >                                         <xsd:enumeration 
-> value="wgs-84"/>
-> >                                         <xsd:enumeration
-> > value="wgs-84egm-96"/>
-> >                                         <xsd:enumeration 
-> value="nad83"/>
-> >                                         <xsd:enumeration 
-> value="nad27"/>
-> >                                         <xsd:enumeration
-> > value="reservedStandard"/>
-> >                                 </xsd:restriction>
-> >                         </xsd:simpleType>
-> >                 </xsd:attribute>
-> >         </xsd:complexType>
-> > </xsd:element>
-> > 
-> >   In the generated types package, I only see one type class file
-> > ValueType.java for the attribute definition in the acope of element
-> > "horizontalDatum".
-> > 
-> >   Can we have the same attribute name ("value" in this example) within
-> > different element definition ("side" and 'horizontalDatum")? How to
-> generate
-> > different type classes for them?
-> >   Any help is appreciated!
-> > 
-> >   Frank
-> > 
-> > -----------------------------------------------------------
-> > 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

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

Reply via email to