commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ricky Panaglucci <hirnbon...@yahoo.co.uk>
Subject Re: [digester] how to make use of xml:lang?
Date Mon, 20 Oct 2003 19:14:36 GMT
i want some properties set according to given locale. 
if no lang:xml is specified in a given element,
its values are taken. if no maching lang:xml is found,
the element without lang:xml or with lang:xml="en" is
taken.

there is a method setSchemaLanguage, but i do not use
schema.

the best solution to me is indeed extending Digester,
hooking into startElement() ... 

locale: en
<obj>
  <attr xml:lang="en" name="foo" value="bar"/> <- take
this
  <attr xml:lang="fr" name="foo" value="baz"/>
</obj>

<obj>
  <attr xml:lang="fr" name="foo" value="baz"/>
  <attr name="foo" value="bar"/>  <- take this
</obj>


ricardo

 --- robert burrell donkin
<robertburrelldonkin@blueyonder.co.uk> wrote: > AFAIK
digester has no explicit support for xml:lang.
> it would be possible 
> to add something to digester to keep track of the
> current xml:lang value 
> but i suspect that it will be possible to solve your
> problem without 
> needing to do so.
> 
> could you explain what you want to do in more
> detail?
> 
> - robert
> 
> On Sunday, October 19, 2003, at 08:22 PM, Ricky
> Panaglucci wrote:
> 
> > hello,
> > does digester handle xml:lang attribute?
> >
> > i would like to generate according to
> > <obj ...>
> >   <attr xml:lang="en" name="foo" value="bar"/>
> >   <attr xml:lang="fr" name="foo" value="baz"/>
> >
> > i suspect this is rather related to sax in general
> > could it be that i have to take care of it myself,
> > including fallback if no matching declaration
> > is found?
> >
> > thank you
> >
> >
> >
>
________________________________________________________________________
> > Want to chat instantly with your online friends? 
> Get the FREE Yahoo!
> > Messenger http://mail.messenger.yahoo.co.uk
> >
> >
>
---------------------------------------------------------------------
> > 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
>  

________________________________________________________________________
Want to chat instantly with your online friends?  Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk

---------------------------------------------------------------------
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