From: Phlip Date: 2009-01-10T18:49:32+09:00 Subject: Re: Help with HTML parsing Tom Morris wrote: > XPath that solves this: > contains(concat(' ', @class, ' '), ' w0 ') > > You can join multiple classes together like this: > contains(concat(' ', @class, ' '), ' w0 ') && contains(concat(' ', > @class, ' '), ' g ') > > It's not pretty. I've written it too much in my life. > I do wish XPath had a class selector. Noted. I'm writing an XPath DSL, above the level of a raw XML library, and I just added to its pending feature list these line-items: # TODO :class => :symbol should do the trick contains(concat(' ', @class, ' '), ' w0 ') # TODO :class => [] should do the trick contains(concat(' ', @class, ' '), ' w0 ') && contains(concat(' ',@class, ' '), ' g ') # TODO :class => a string should be raw. Those won't fix low-level XPath, but they will be useful when my DSL targets XHTML...