commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: [digester] how to make use of xml:lang?
Date Mon, 20 Oct 2003 21:57:49 GMT
Simon Kitching wrote:

>On Tue, 2003-10-21 at 22:57, Simon Kitching wrote:
>  
>
>>Hi Ricky,
>>
>>    
>>
>
>Doh! I wasn't thinking so clearly..the suggestion below is complete
>rubbish :-)
>
>  
>
>>Implementing such a Rules class would be non-trivial, though. As a
>>simpler solution along the same lines, how about writing a LangRules
>>class which extends BaseRules (or whichever), and has a match method
>>like:
>>  List matches = super.match(...)
>>  for each rule in matches
>>  {
>>    if xml:lang exists, 
>>       and the attribute value is not the desired language
>>    {
>>      remove the element from the match list
>>    }
>>  }
>>    
>>
>
>In order to match on the xml:lang attribute of an element in a Rules
>object, you would need access to the element's attributes. And currently
>Digester doesn't provide that info.
>
>  
>

But you could certainly supply your own Rule (no trailing "s") 
implementation whose begin() method checked the Attributes that are 
passed to see which (if any) xml:lang attribute was set.



>I still think that the Rules object is the correct place to do this sort
>of matching but it obviously won't be that simple.
>
>Regards,
>
>Simon
>
>  
>

Craig


>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message