[EMAIL PROTECTED] wrote: > bruce wrote: >> 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/..../[EMAIL PROTECTED]'foo'] >> >> is it possible to do soomething like [EMAIL PROTECTED]/fo/] so i'd match the >> class >> attribute with fo.... >> >> i'm trying to parse HTML/Web docs... > > 4Suite [1] supports regex in XPath using the EXSLT community standard's > regex module [2]. It would be something like: > > [re:match(@class, 'fo.*'] > > With the re prefix set as required by the EXSLT module.
Same for lxml, although it's currently only enabled in XSLT: http://codespeak.net/lxml/api.html#xslt Guess I should change that for 1.1... Stefan -- http://mail.python.org/mailman/listinfo/python-list