[ http://issues.apache.org/jira/browse/JAXME-51?page=all ]
     
Jochen Wiedmann closed JAXME-51:
--------------------------------

    Resolution: Invalid

I admit, that this policy is not what I would expect as well. Nevertheless, it 
is intentional, following the JAXB specification (see quote below).

To fix the problem, you have two options:

a) Use the "underscoreBinding" option in the jaxb:globalBindings
   and set it to "asCharInWord". For example, like this:

     <?xml version='1.0' encoding='utf-8'?>
     <xs:schema
         xmlns:xs='http://www.w3.org/2001/XMLSchema'
         elementFormDefault='qualified'
         xmlns='http://ws.apache.org/jaxme/test/jira/jaxme51'
         xmlns:jaxb='http://java.sun.com/xml/ns/jaxb'
         targetNamespace='http://ws.apache.org/jaxme/test/jira/jaxme51'
         jaxb:version='1.0'>
       <xs:annotation><xs:appinfo>
         <jaxb:globalBindings underscoreBinding='asCharInWord'/>
       </xs:appinfo></xs:annotation>
       ...

b) Use the <jaxb:property name="..."> customization on an
   element level.


6.5.3 Underscore Handling
This section applies only when XML names are being mapped to a legal Java
Identifier by default. In this case, the treatment of underscore ('_') is 
determined
by underscoreBinding.
If underscoreBinding is "asWordSeparator", then underscore
('_') must be treated as a punctuation character; otherwise if
underscoreBinding is "asCharInWord", then underscore ('_') must
be treated as a character in the word. The default value for
underscoreBinding is "asWordSeparator".


> JaxMe does not distinguish element1 and element_1
> -------------------------------------------------
>
>          Key: JAXME-51
>          URL: http://issues.apache.org/jira/browse/JAXME-51
>      Project: JaxMe
>         Type: Bug
>   Components: JaxMe Core
>     Versions: current (nightly)
>     Reporter: Geert Barentsen
>     Priority: Minor

>
> Minor bug: an IllegalStateException may occur when a number follows an 
> underscore in an element name. The schema below demonstrates the problem: 
> JaxMe will generate two fields called "_element1".
> <?xml version="1.0" encoding="utf-8"?>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
> elementFormDefault="qualified" xmlns="http://bug"; 
> targetNamespace="http://bug";>
>  <xsd:element name="bug">
>   <xsd:complexType>
>    <xsd:all>
>     <xsd:element name="element1" type="xsd:string" />
>     <xsd:element name="element_1" type="xsd:string" />
>    </xsd:all>
>   </xsd:complexType>
>  </xsd:element>
> </xsd:schema>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to