commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Kitching <skitch...@apache.org>
Subject Re: [digester] using xpath to select nodes
Date Fri, 10 Feb 2006 05:08:34 GMT
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/pageclass[@name='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.

As this has been asked before, I've created a new FAQ entry; see the
last entry in this page:
  http://wiki.apache.org/jakarta-commons/Digester/FAQ

Regards,

Simon


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