On Wed, Feb 4, 2009 at 1:43 PM, Евгений Антаев <ant...@gmail.com> wrote:
> Hi
>
> Can I use attribute value as a constraint in a pattern for Digester?
>
> For example
>
> <addressBook>
>    ...
>    <contact>
>        <phone type='home'>00000000</phone>
>        <phone type='work'>99999999</phone>
>    </contact>
>    ...
> </addressBook>
>
> I would like to use pattern to match home phone only. Something like
> "contact/pho...@type='home']".
>
<snip/>

No. Commons Digester uses what it calls element matching patterns --
they aren't true XPath expressions so the example above can't be used
as intended (only element names are matched).

Short of defining your own digester Rule or Rules implementations,
perhaps you can simply ignore the bits you don't care about (so lets
say you use SetNextRule to add Phone objects to a Contact object, you
could ignore phones that aren't home phones).

-Rahul


> ------
> Evgeny
>
> Thanks
>

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

Reply via email to