users@jaxb.java.net

Re: XJC : Leading Underscores and underscoreBinding

From: Hank Ratzesberger <hankr_at_crustal.ucsb.edu>
Date: Wed, 25 Jun 2003 15:05:49 -0700

Ryan, et. al.,

Operator error. My <globalBindings> was not in the
right location (missing for the <bindings> for that
particular schema.

Sorry for the error and thanks for reviewing it.

--Hank

----- Original Message -----
From: "Ryan Shoemaker - JavaSoft East" <Ryan.Shoemaker_at_Sun.COM>
To: <JAXB-INTEREST_at_JAVA.SUN.COM>
Sent: Wednesday, June 25, 2003 2:47 PM
Subject: Re: XJC : Leading Underscores and underscoreBinding


> Hank Ratzesberger wrote:
>
> >
> >
> > There is, however, a name collision for the element "_Surface"
> > because the class "Surface" also exists. Indeed, GML
> > does this for many, many elements, creating abstract versions
> > with "_" .
> >
> > I have worked around this problem by specifically binding
> > that classname, but I wonder if this should be considered a
> > bug -- it appears that leading underscores are ignored regardless
> > of underscoreBinding.
> >
>
> I'm not seeing the same behavior (unless I'm misunderstanding the
problem).
> Take a look at the attached schema and binding customization. I declare
> two elements "_foo" and "foo" - xjc handles them exactly as the spec says
> it should with no name collisions, generating _foo.java and Foo.java. All
> of the generated code compiles under javac as well.
>
> Please modify the sample schema to reproduce the problem and send it back
> to the list....
>
> > Apologies if I missed this in the documentation, but I only
> > detected a conflict between _ and the specification of a
> > java identifier.
> >
>
> I'm not exactly sure what you mean by this...
>
> Thanks,
>
> --Ryan
>


----------------------------------------------------------------------------
----
> <jaxb:bindings version="1.0"
>               xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
>               xmlns:xs="http://www.w3.org/2001/XMLSchema">
>
>     <jaxb:bindings schemaLocation="foo.xsd" node="/xs:schema">
>         <!-- see JAXB Specification sec 6.5 for more detail -->
>         <jaxb:globalBindings
>             fixedAttributeAsConstantProperty="true"
>             collectionType="indexed"
>             typesafeEnumBase="xs:string"
>             choiceContentProperty="false"
>             typesafeEnumMemberName="generateError"
>             bindingStyle="modelGroupBinding"
>             enableFailFastCheck="false"
>             generateIsSetMethod="false"
>             underscoreBinding="asCharInWord"/>
>     </jaxb:bindings>
> </jaxb:bindings>
----------------------------------------------------------------------------
----
> <?xml version="1.0" encoding="UTF-8"?>
> <schema xmlns="http://www.w3.org/2001/XMLSchema">
>     <element name="foo" type="int"/>
>     <element name="_foo" type="int"/>
> </schema>
>