users@jaxb.java.net

Re: Underscores are ignored ?

From: Ryan Shoemaker - JavaSoft East <Ryan.Shoemaker_at_Sun.COM>
Date: Tue, 28 Sep 2004 09:31:45 -0400

NAGY Endre wrote:
>
> I assume the underscore is eaten upon conversion to java
>
> Is there an elegant way to get arround this without hacking at somebody
> elses (ie opengis's) schema specification
>

You can use the underscoreBinding customization to control this behavior:

<jxb:bindings version="1.0"
                xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
                xmlns:xs="http://www.w3.org/2001/XMLSchema">
   <jxb:bindings schemaLocation="foo.xsd" node="/xs:schema">

     <!-- @underscoreBinding can be set to either "asCharInWord"
          or "asWordSeparator" (default). See section 6.5.3 of
          the spec for more detail -->
     <jxb:globalBindings underscoreBinding="asCharInWord"/>
     <jxb:schemaBindings>
       ...
     </>
   </>
</>

This approach would affect the underscore handling across all of the
schemas you are processing. If that isn't what you're interested in
then you can take Aleksei's recommendation to use a jxb:class custom-
ization to resolve the name collision.

--Ryan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net