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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





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



Reply via email to