DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16485>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16485

BeanDeserializer error when XML element starts with a capital letter

[EMAIL PROTECTED] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX



------- Additional Comments From [EMAIL PROTECTED]  2003-02-17 23:10 -------
>With the current BeanDeserializer its imposible to use a bean like
>that when the schema uses names which start with a capital letter.

Exactly.  This is, IMHO, 100% correct.  XML and Java are both case-sensitive 
technologies, and it's possible (though misguided) to have "Name" and "name" 
elements in a schema/class which mean different things and coexist peacefully.

The purpose of the TypeDesc metadata which can be associated with Java classes 
is precisely to control non-default XML<->Java name mappings (i.e. "<Name>" <-
> "public String name").  So, if you want your classes to associate with a 
known schema, you should use the metadata to control the serialization to 
match the desired XML.  Note that you don't have to change the data class 
itself to do this - you can create a class called <classname>_Helper which 
contains a static public method "TypeDesc getTypeDesc()" which returns the 
metadata.  So if you have a class org.foo.MyClass, you make 
org.foo.MyClass_Helper:

package org.foo;
public class MyClass_Helper {
    private TypeDesc typeDesc;
    public static TypeDesc getTypeDesc() { return typeDesc; }
    static {
       typeDesc = new TypeDesc();
       // ... initialize type metadata ...
    }
}

If for some reason you need your classes to associate with UNKNOWN schema 
(i.e. for some twisted reason you have no idea that <Name> and not <name> will 
be coming down the wire), a "lax" policy like you suggest would be the only 
solution.  However, I don't want that to go into Axis unless and until there's 
a very good reason for it (and even then it should be an option, not the 
default behavior).

I'm marking this WONTFIX for now.  If you really think we should have 
the "lax" option, you can reopen it and describe the use-case.  Thanks!

Reply via email to