users@jaxb.java.net

mapping element with a single attribute?

From: Jason Harrop <jharrop_at_gmail.com>
Date: Thu, 13 Dec 2007 10:42:56 +1100

Hi

I think this is a very simple question.

I have an element pPr defined to have a sequence of child elements,
one of which is pStyle:

<xsd:element name="pPr" >
    <xsd:complexType>
        <xsd:sequence>
                <xsd:element name="pStyle" minOccurs="0">
                      <xsd:complexType>
                            <xsd:attribute name="val" type="xsd:string"/>
                      </xsd:complexType>
                </xsd:element>
:

You can see that pStyle is just a string.

So I would like the PPr class generated by xjc to define

    String pStyle;

What is the simplest way to achieve this please?

thanks

Jason