<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: XPath for CSS classes</title>
	<atom:link href="http://cowburn.info/2009/06/15/xpath-css-class/feed/" rel="self" type="application/rss+xml" />
	<link>http://cowburn.info/2009/06/15/xpath-css-class/</link>
	<description>Online storage depot for Peter Cowburn</description>
	<lastBuildDate>Thu, 03 May 2012 06:33:06 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Peter</title>
		<link>http://cowburn.info/2009/06/15/xpath-css-class/#comment-64334</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Wed, 04 May 2011 20:09:26 +0000</pubDate>
		<guid isPermaLink="false">http://cowburn.info/?p=203#comment-64334</guid>
		<description>@Akshay Raje, positional selectors are perfectly possible (and even more concise) in XPath, your example would be &lt;code&gt;tr[4]&lt;/code&gt; (since the &lt;code&gt;:eq(n)&lt;/code&gt; is zero-based, and XPath&#039;s one-based).</description>
		<content:encoded><![CDATA[<p>@Akshay Raje, positional selectors are perfectly possible (and even more concise) in XPath, your example would be <code>tr[4]</code> (since the <code>:eq(n)</code> is zero-based, and XPath&#8217;s one-based).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Akshay Raje</title>
		<link>http://cowburn.info/2009/06/15/xpath-css-class/#comment-64333</link>
		<dc:creator>Akshay Raje</dc:creator>
		<pubDate>Wed, 04 May 2011 19:57:55 +0000</pubDate>
		<guid isPermaLink="false">http://cowburn.info/?p=203#comment-64333</guid>
		<description>What about selectors like tr:eq(3) ?</description>
		<content:encoded><![CDATA[<p>What about selectors like tr:eq(3) ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sebastien</title>
		<link>http://cowburn.info/2009/06/15/xpath-css-class/#comment-55943</link>
		<dc:creator>Sebastien</dc:creator>
		<pubDate>Wed, 12 Aug 2009 20:48:11 +0000</pubDate>
		<guid isPermaLink="false">http://cowburn.info/?p=203#comment-55943</guid>
		<description>Thanks Peter. I double-checked, and you are right, that tool was not designed to handle more than one class specifier. I updated it to match your advice, but using a boolean operator.

//p[contains(concat(&quot; &quot;,@class,&quot; &quot;),concat(&quot; &quot;,&quot;sb-fs&quot;,&quot; &quot;)) and contains(concat(&quot; &quot;,@class,&quot; &quot;),concat(&quot; &quot;,&quot;bar&quot;,&quot; &quot;))]</description>
		<content:encoded><![CDATA[<p>Thanks Peter. I double-checked, and you are right, that tool was not designed to handle more than one class specifier. I updated it to match your advice, but using a boolean operator.</p>
<p>//p[contains(concat(" ",@class," "),concat(" ","sb-fs"," ")) and contains(concat(" ",@class," "),concat(" ","bar"," "))]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://cowburn.info/2009/06/15/xpath-css-class/#comment-55942</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Wed, 12 Aug 2009 20:27:07 +0000</pubDate>
		<guid isPermaLink="false">http://cowburn.info/?p=203#comment-55942</guid>
		<description>Hi Sebastien, it appears that the tool you&#039;re using to convert from CSS selector to XPath query does not like multiple class names. If you look in the middle of the XPath there is an asterisk (*) which should not be there. As a result the corrected XPath should be:
&lt;code&gt;//p[contains(concat(&quot; &quot;,@class,&quot; &quot;),concat(&quot; &quot;,&quot;sb-fs&quot;,&quot; &quot;))][contains(concat(&quot; &quot;,@class,&quot; &quot;),concat(&quot; &quot;,&quot;bar&quot;,&quot; &quot;))]&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Hi Sebastien, it appears that the tool you&#8217;re using to convert from CSS selector to XPath query does not like multiple class names. If you look in the middle of the XPath there is an asterisk (*) which should not be there. As a result the corrected XPath should be:<br />
<code>//p[contains(concat(" ",@class," "),concat(" ","sb-fs"," "))][contains(concat(" ",@class," "),concat(" ","bar"," "))]</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sebastien</title>
		<link>http://cowburn.info/2009/06/15/xpath-css-class/#comment-55940</link>
		<dc:creator>Sebastien</dc:creator>
		<pubDate>Wed, 12 Aug 2009 20:17:43 +0000</pubDate>
		<guid isPermaLink="false">http://cowburn.info/?p=203#comment-55940</guid>
		<description>Hi.

Thanks for the pointer. Emogrifier looks pretty handy. I was wondering if you could give me a hint about the problem below...

The following CSS rule:
	&lt;code&gt;p.sb-fs.bar&lt;/code&gt;
is converted by emogrifier into the following XPath expression:
	&lt;code&gt;//p[contains(concat(&quot; &quot;,@class,&quot; &quot;),concat(&quot; &quot;,&quot;sb-fs&quot;,&quot; &quot;))]*[contains(concat(&quot; &quot;,@class,&quot; &quot;),concat(&quot; &quot;,&quot;bar&quot;,&quot; &quot;))]&lt;/code&gt;

Which seems to completely puzzle PHP&#039;s DOMXpath, resulting in no match:

&lt;q&gt;Warning: DOMXPath::query() [domxpath.query]: Invalid expression&lt;/q&gt;

Thanks!</description>
		<content:encoded><![CDATA[<p>Hi.</p>
<p>Thanks for the pointer. Emogrifier looks pretty handy. I was wondering if you could give me a hint about the problem below&#8230;</p>
<p>The following CSS rule:<br />
	<code>p.sb-fs.bar</code><br />
is converted by emogrifier into the following XPath expression:<br />
	<code>//p[contains(concat(" ",@class," "),concat(" ","sb-fs"," "))]*[contains(concat(" ",@class," "),concat(" ","bar"," "))]</code></p>
<p>Which seems to completely puzzle PHP&#8217;s DOMXpath, resulting in no match:</p>
<p><q>Warning: DOMXPath::query() [domxpath.query]: Invalid expression</q></p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

