Handling of names with '-' symbol
---------------------------------

                 Key: AXIS2-2468
                 URL: https://issues.apache.org/jira/browse/AXIS2-2468
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: codegen
    Affects Versions: 1.2
         Environment: Ubuntu 6.10, Jdk 1.4.2
            Reporter: Jose Antonio


I have a schema with an attribute named 'reference-scheme' and I need to use it 
in my code. When I try to generate code using ADB I get the following:

..............................
 // handle attribute "reference-scheme"
                    java.lang.String tempAttribreference-scheme =
                      reader.getAttributeValue("","reference-scheme");
                   if (tempAttribreference-scheme!=null){
                         java.lang.String content = tempAttribreference-scheme;
                        
                                                 object.setReferenceScheme(
                                                    
org.apache.axis2.databinding.utils.ConverterUtil.convertToAnyURI(tempAttribreference-scheme));
                                            
                    } else {
                       
                    }
                    handledAttributes.add("reference-scheme");
                    
                    
                    reader.next();
.........................

And that doesn't compile, so when an attribute or element name contains a '-' 
character, the generated variables should replace it by _ so it generates the 
following code:

......................................
 // handle attribute "reference-scheme"
                    java.lang.String tempAttribreference_scheme =
                      reader.getAttributeValue("","reference-scheme");
                   if (tempAttribreference_scheme!=null){
                         java.lang.String content = tempAttribreference_scheme;
                        
                                                 object.setReferenceScheme(
                                                    
org.apache.axis2.databinding.utils.ConverterUtil.convertToAnyURI(tempAttribreference_scheme));
                                            
                    } else {
                       
                    }
                    handledAttributes.add("reference-scheme");
                    
                    
                    reader.next();
.............................

That compiles or something similar.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply via email to