users@jaxb.java.net

Re: JAXB mapping

From: hallwyl <hallwyl_at_diku.dk>
Date: Tue, 18 Sep 2007 13:57:22 -0700 (PDT)

Denis-51 wrote:
>
> <xsd:complexType name="Item">
> <xsd:sequence>
> <xsd:element name="pris" type="xsd:double"/>
> <xsd:element name="billede" type="xsd:string"/>
> </xsd:sequence>
> </xsd:complexType>
>
> As you see elements with name "pris and billede" - are danish words and
> they will be used in XML documents, but in Java Code I want to have
> English
> names for methods. How I may do it?
>

I suggest you try using (external) custom binding with something like this:

    <jxb:bindings
node=".//xsd:complexType[@name='item']/xsd:element[@name='billede']">
      <jxb:property name="Picture"/>
    </jxb:bindings>
    <jxb:bindings
node=".//xsd:complexType[@name='item']/xsd:element[@name='pris']">
      <jxb:property name="Price"/>
    </jxb:bindings>


-- 
View this message in context: http://www.nabble.com/JAXB-mapping-tf4341997.html#a12766022
Sent from the java.net - jaxb users mailing list archive at Nabble.com.