Hello all,

I've a similar problem as described by Jim which I tried to solve by
renaming a XML attribute using a binding file.
Hoever I had no success. I read the link below, but couldn't manage the
attributeBinding.
It would be great, if somebody has an example.

Thanks a lot,
Achim

-----Original Message-----
From: Rhett Sutphin [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 21, 2004 8:04 PM
To: [EMAIL PROTECTED]
Subject: Re: [castor-dev] Mapping for attribute and element with same
name...


Hi Jim,

If you are using source generator, this is a job for a binding file.  You
can rename the class property for the attribute or the element (or both)
using a <member> element inside an <elementBinding> or <attributeBinding>
element.

http://castor.exolab.org/sourcegen.html#Binding-File

Rhett

James Carter wrote:
> Hello all,
>
> From a colleague...
>
> Thanks for any ideas,
> Jim Carter
> --------------------------------------------------------------------------
----------------------------------------------------------------------------
------------------------------------------------------------------
>
> Here is a snippet of the schema which is causing a problem.
>
> The complex type PersonType has an element and attribute with the same
> name.  In the example below, "BirthDate" is the duplicate name.  Could
> you provide an example of what mapping is required to support this
> situation.
>
>
>       <xsd:complexType name="PersonType">
>             <xsd:sequence>
>                   <xsd:element name="Identifiers" minOccurs="0">
>                         <xsd:complexType>
>                               <xsd:sequence>
>                                     <xsd:element name="SSN"
> minOccurs="0">
>                                           <xsd:complexType>
>                                                 <xsd:simpleContent>
>                                                       <xsd:extension
> base="codv:SSNType"/>
>                                                 </xsd:simpleContent>
>                                           </xsd:complexType>
>                                     </xsd:element>
>                                     <xsd:element name="DriversLicense"
> type="codv:DriversLicenseType" minOccurs="0"/>
>                               </xsd:sequence>
>                         </xsd:complexType>
>                   </xsd:element>
>
>                   <xsd:element name="BirthDate" type="xsd:date"
> minOccurs="0"/>
>
>                   <xsd:element name="Name" type="NameType"
> minOccurs="0"/>
>                   <xsd:element name="Contacts" type="ContactsType"
> minOccurs="0"/>
>                   <xsd:element name="CitizenshipStatusCode"
> nillable="true" minOccurs="0">
>                         <xsd:simpleType>
>                               <xsd:restriction base="xsd:string">
>                                     <xsd:length value="1"/>
>                                     <xsd:enumeration value="1"/>
>                                     <xsd:enumeration value="2"/>
>                                     <xsd:enumeration value="3"/>
>                               </xsd:restriction>
>                         </xsd:simpleType>
>                   </xsd:element>
>                   <xsd:element ref="codv:NoteMessage" minOccurs="0"/>
>             </xsd:sequence>
>             <xsd:attribute name="SSN" type="codv:SSNType"
> use="required"/>
>
>             <xsd:attribute name="BirthDate" type="xsd:date"
> use="required"/>
>
>             <xsd:attribute name="LastName" use="required">
>                   <xsd:simpleType>
>                         <xsd:restriction base="xsd:string">
>                               <xsd:minLength value="0"/>
>                               <xsd:maxLength value="35"/>
>                         </xsd:restriction>
>                   </xsd:simpleType>
>             </xsd:attribute>
>       </xsd:complexType>
>
> -----------------------------------------------------------
> 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