xpath question

Simon Forman rogue_pedro at yahoo.com
Sun Jul 2 17:10:24 EDT 2006


bruce wrote:
> hi
>
> is there anyone with XPath expertise here? i'm trying to figure out if
> there's a way to use regex expressions with an xpath query? i've seen
> references to the ability to use regex and xpath/xml, but i'm not sure how
> to do it...
>
> i have a situation where i have something like:
>  /html/table/..../[@class='foo']
>
> is it possible to do soomething like [@class~=/fo/] so i'd match the class
> attribute with fo....
>
> i'm trying to parse HTML/Web docs...
>
> thanks
>
> -bruce

I'll take this one...

Dude,  this is a *python* mailing list, not an xml/xpath/regex one.  In
addition, the regex syntax you're using above (~=/fo/) looks like
*perl* code--  but I wouldn't know 'cause I don't use perl myself.

Now it's entirely possible that there are *many* people here that are
xml/xpath/regex Kung Fu Masters,  *and* it's entirely possible that one
or more of them are about to answer your question informatively and in
exhaustive detail.  It's also entirely possible that this is the most
friendly and informative reply that you're going to get, here.


Try a more appropriate newsgroup, and good luck.




More information about the Python-list mailing list