Re: [libxml++] Node's xpath methods



On Sat, 2003-02-15 at 11:45, Rasmus Kaj wrote:
> >>>>> "MC" == Murray Cumming <murrayc t-online de> writes:
> 
>  MC> Also, maybe we should rename 
> 
>  MC>  NodeSet find(const std::string& xpath) const;
> 
>  MC> to find_by_xpath() or something similar? find() seems a bit generic,
>  MC> particularly when it just takes std::string which is also very generic.
> 
> How about having a class XPath as a parameter to find, and an
> (explicit) constructor from std::string to XPath?  That way, one can
> write "mynode.find(XPath(my_xpath_string));" if one have a string.
> 
> Also, the XPath constructor could (in the future) actually parse the
> xpath, so that doesn't have to be done for every find().

That sounds quite sensible, and I think Xerce-J does a similar thing.
Would you like to investigate and submit a patch? I've never used xpath
myself.

-- 
Murray Cumming
murray usa net
www.murrayc.com





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]