users@jaxb.java.net

XJC : Leading Underscores and underscoreBinding

From: Hank Ratzesberger <hankr_at_crustal.ucsb.edu>
Date: Wed, 25 Jun 2003 11:59:52 -0700

I have the following declaration from the geographic
modeling language schema:

<element abstract="true" name="_Surface"
  substitutionGroup="gml:_GeometricPrimitive"
type="gml:AbstractSurfaceType">
  <annotation>
  <documentation>The &quot;_Surface&quot; element is the
    abstract head of the substituition group for all
    (continuous) surface elements.</documentation>
  </annotation>
</element>

which I process with the following customized binding:

<jxb:globalBindings bindingStyle="modelGroupBinding"
  underscoreBinding="asCharInWord"/>
...


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.

Apologies if I missed this in the documentation, but I only
detected a conflict between _ and the specification of a
java identifier.

Thanks again to everyone for the help. Overall, I like
this specification very much, although I was impressed with
the Eclipse modeling framework, which created classes for
the whole iso19115 and geographic modeling language on
the first pass (after identifying some errors in the
schema like using a restriction like an extension).

Very best regards,
Hank

============================================
Replying to a list? I'll get my copy there!

Hank Ratzesberger
http://crustal.ucsb.edu/ | http://neesgrid.org/
Institute for Crustal Studies
University of California, Santa Barbara
============================================