axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aleksander Slominski <as...@cs.indiana.edu>
Subject Re: [Axis2][OM] Simpler way to get NameSpace
Date Thu, 09 Dec 2004 05:11:10 GMT
Srinath Perera wrote:

>Hi Alek
>
>On Wed, 08 Dec 2004 23:04:32 -0500, Aleksander Slominski
><aslom@cs.indiana.edu> wrote:
>  
>
>>Srinath Perera wrote:
>>
>>
>>
>>    
>>
>>>Hi All;
>>>
>>>l am following up the  "[Axis2] OM issues" 's improving the
>>>OMNamespace part now we use.
>>>
>>>OMNameSpace omNs = element.getNameSpace() ;
>>>String nsURI = omNs.getValue();
>>>
>>>I like to propose an improvement
>>>
>>>a) handle OMNameSapce completly inside  the OMImpl (where the
>>>OMnamespace is not part of OMAPI as well)
>>>  OMElemnt{
>>>       void registerANameSpace(String uri,String prefix);
>>>       void registerANameSpace(String uri); //to let the parser
>>>decide the prefix
>>>       String getNameSpaceURI();
>>>   }
>>>
>>>b) some compromise, keep the OMNamespace and creating OMNamesapce as
>>>it is. but add a getNamesapceURI() to the OMElement as the
>>>
>>>OMNameSpace omNs = element.getNameSpace() ;
>>>String nsURI = omNs.getValue();
>>>
>>>
>>>      
>>>
>>IMHO OmNamespace should be immutable object with just two properties:
>>namespace name (String) that is always not null and prefix (String) that
>>can be null - that would keep it consistent with xml infoset items and
>>properties: http://www.w3.org/TR/xml-infoset/#infoitem.namespace
>>
>>    
>>
>>>is really annoying and sometime I find the return value of the
>>>getNameSpace() is null which is impossible for valid SOAPMessage!
>>>
>>>
>>>      
>>>
>>so it should never return it and if it does you have simple NPE to find
>>where it happened...
>>    
>>
>But alek wrting two lines where when u need one all cases (with DOM
>ect ) is what I do not like. this is one of THE MOST COMMONLY called
>methods in the OM!
>  
>
you can write it in one line: element.getNamespace().getNamespaceName() :)

alek

>  
>
>>--
>>The best way to predict the future is to invent it - Alan Kay
>>
>>
>>    
>>


-- 
The best way to predict the future is to invent it - Alan Kay


Mime
View raw message