On 2/9/06, Simon Kitching <[EMAIL PROTECTED]> wrote:
>
> On Thu, 2006-02-09 at 16:46 +0100, Valerio Schiavoni wrote:
> > Hello,
> > i have this kind of xml i want to parse:
> > <pageclass name='news'>
> > <page pageid="33">
> > <metadata name="title>
> > a title
> > </metadata>
> > <metadata name="remoteURL">
> > a url
> > </metadata>
> > </page>
> > </pageclass>
> > <pageclass name='other'>
> > <page pageid="xx">
> > ....
> > </page>
> > </pageclass>
> >
> > So in the digester i have this code (only relevant part ):
> >
> > digester.setRules(new ExtendedBaseRules());
> > digester.addObjectCreate("website/[EMAIL PROTECTED]'news']/page",
> > Notizia.class.getName());
> >
> > which doesn't work as I was supposing: when I try to peek the object on
> the
> > stack, i get a NPE.
> > So the question is: does digester support that kind of xpath expressions
> to
> > select nodes?
>
> No. None of the rule-matching implementations support XPath expressions.
It would also likely require some pretty fundamental architectural changes,
since Digester uses a SAX parser underneath the covers (and never has access
to a data structure representing the entire document). XPath queries seem
much more appropriate when you've got the whole DOM of the document to
examine.
Craig