<?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: PHP XPath Tutorial &#8211; Advanced XML Part 1</title>
	<atom:link href="http://ditio.net/2008/12/01/php-xpath-tutorial-advanced-xml-part-1/feed/" rel="self" type="application/rss+xml" />
	<link>http://ditio.net/2008/12/01/php-xpath-tutorial-advanced-xml-part-1/</link>
	<description>Practical guide to web development, marketing and programming</description>
	<lastBuildDate>Tue, 07 Sep 2010 06:17:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: buzzknow</title>
		<link>http://ditio.net/2008/12/01/php-xpath-tutorial-advanced-xml-part-1/comment-page-1/#comment-54643</link>
		<dc:creator>buzzknow</dc:creator>
		<pubDate>Tue, 03 Aug 2010 09:03:09 +0000</pubDate>
		<guid isPermaLink="false">http://ditio.net/?p=163#comment-54643</guid>
		<description>How to create XML like an example with createElement function in PHP?

thanks</description>
		<content:encoded><![CDATA[<p>How to create XML like an example with createElement function in PHP?</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: limo in baltimore</title>
		<link>http://ditio.net/2008/12/01/php-xpath-tutorial-advanced-xml-part-1/comment-page-1/#comment-52307</link>
		<dc:creator>limo in baltimore</dc:creator>
		<pubDate>Thu, 22 Jul 2010 02:11:00 +0000</pubDate>
		<guid isPermaLink="false">http://ditio.net/?p=163#comment-52307</guid>
		<description>nice work thanks or sharing great tutorial</description>
		<content:encoded><![CDATA[<p>nice work thanks or sharing great tutorial</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Serg</title>
		<link>http://ditio.net/2008/12/01/php-xpath-tutorial-advanced-xml-part-1/comment-page-1/#comment-37881</link>
		<dc:creator>Serg</dc:creator>
		<pubDate>Mon, 12 Apr 2010 23:24:51 +0000</pubDate>
		<guid isPermaLink="false">http://ditio.net/?p=163#comment-37881</guid>
		<description>Very nice! I always have some headache with xml. Hope it will be finished with this tool.&lt;a href=&quot;http://makecandles.ru&quot; rel=&quot;nofollow&quot;&gt;&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Very nice! I always have some headache with xml. Hope it will be finished with this tool.<a href="http://makecandles.ru" rel="nofollow"></a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: paul</title>
		<link>http://ditio.net/2008/12/01/php-xpath-tutorial-advanced-xml-part-1/comment-page-1/#comment-34741</link>
		<dc:creator>paul</dc:creator>
		<pubDate>Mon, 15 Mar 2010 10:29:31 +0000</pubDate>
		<guid isPermaLink="false">http://ditio.net/?p=163#comment-34741</guid>
		<description>great resource will implement on my new project.</description>
		<content:encoded><![CDATA[<p>great resource will implement on my new project.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Riley Coury</title>
		<link>http://ditio.net/2008/12/01/php-xpath-tutorial-advanced-xml-part-1/comment-page-1/#comment-34589</link>
		<dc:creator>Riley Coury</dc:creator>
		<pubDate>Sat, 13 Mar 2010 15:30:53 +0000</pubDate>
		<guid isPermaLink="false">http://ditio.net/?p=163#comment-34589</guid>
		<description>Domme ladies makes me so haèèy , why dont you post some more?</description>
		<content:encoded><![CDATA[<p>Domme ladies makes me so haèèy , why dont you post some more?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arash M.</title>
		<link>http://ditio.net/2008/12/01/php-xpath-tutorial-advanced-xml-part-1/comment-page-1/#comment-32338</link>
		<dc:creator>Arash M.</dc:creator>
		<pubDate>Tue, 09 Feb 2010 04:47:16 +0000</pubDate>
		<guid isPermaLink="false">http://ditio.net/?p=163#comment-32338</guid>
		<description>opps sorry the xml tags where stripped!</description>
		<content:encoded><![CDATA[<p>opps sorry the xml tags where stripped!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arash M.</title>
		<link>http://ditio.net/2008/12/01/php-xpath-tutorial-advanced-xml-part-1/comment-page-1/#comment-32337</link>
		<dc:creator>Arash M.</dc:creator>
		<pubDate>Tue, 09 Feb 2010 04:46:02 +0000</pubDate>
		<guid isPermaLink="false">http://ditio.net/?p=163#comment-32337</guid>
		<description>awesome article! however I was trying to run this piece of code against the following xml that is returned from ebay and I did not get any response. It seems like the SimpleXML xpath does not like some of the queries or at least I couldn&#039;t make it work. It does, however work if you only run the xpath query in a xpath query test tools!


341296208834
−

http://product.half.ebay.com/GMAT-Quantitative-Review-Paperback-2005_W0QQprZ48636818QQtgZvidetailsQQitemZ341296208834

Camp Hill, Pennsylvania
1
−

24
80.0

1.99
−

−

http://shops.half.ebay.com/wutangxx3_W0QQsellerZwutangxx3

wutangxx3

US
VeryGood
−

Very good condition with no writing!  Fast shipping!



// the php code

$xml = simplexml_load_file(the xml file);
 $xml-&gt;registerXpathNamespace(&#039;ebay&#039;,&#039;urn:ebay:apis:eBLBaseComponents&#039;);
  try{

	//this should give me the sorename that has the current price of 1.98
  	$resp = $xml-&gt;xpath(&quot;//ebay:CurrentPrice[.=1.98]/following-sibling::Storefront/StoreName&quot;);
  														
  
  } catch (Exception $e)
  {
  	echo $e-&gt;getMessage();
  }           
 
var_dump($resp);//returns nothing

any idea?</description>
		<content:encoded><![CDATA[<p>awesome article! however I was trying to run this piece of code against the following xml that is returned from ebay and I did not get any response. It seems like the SimpleXML xpath does not like some of the queries or at least I couldn&#8217;t make it work. It does, however work if you only run the xpath query in a xpath query test tools!</p>
<p>341296208834<br />
−</p>
<p><a href="http://product.half.ebay.com/GMAT-Quantitative-Review-Paperback-2005_W0QQprZ48636818QQtgZvidetailsQQitemZ341296208834" rel="nofollow">http://product.half.ebay.com/GMAT-Quantitative-Review-Paperback-2005_W0QQprZ48636818QQtgZvidetailsQQitemZ341296208834</a></p>
<p>Camp Hill, Pennsylvania<br />
1<br />
−</p>
<p>24<br />
80.0</p>
<p>1.99<br />
−</p>
<p>−</p>
<p><a href="http://shops.half.ebay.com/wutangxx3_W0QQsellerZwutangxx3" rel="nofollow">http://shops.half.ebay.com/wutangxx3_W0QQsellerZwutangxx3</a></p>
<p>wutangxx3</p>
<p>US<br />
VeryGood<br />
−</p>
<p>Very good condition with no writing!  Fast shipping!</p>
<p>// the php code</p>
<p>$xml = simplexml_load_file(the xml file);<br />
 $xml-&gt;registerXpathNamespace(&#8216;ebay&#8217;,'urn:ebay:apis:eBLBaseComponents&#8217;);<br />
  try{</p>
<p>	//this should give me the sorename that has the current price of 1.98<br />
  	$resp = $xml-&gt;xpath(&#8220;//ebay:CurrentPrice[.=1.98]/following-sibling::Storefront/StoreName&#8221;);</p>
<p>  } catch (Exception $e)<br />
  {<br />
  	echo $e-&gt;getMessage();<br />
  }           </p>
<p>var_dump($resp);//returns nothing</p>
<p>any idea?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg</title>
		<link>http://ditio.net/2008/12/01/php-xpath-tutorial-advanced-xml-part-1/comment-page-1/#comment-31067</link>
		<dc:creator>Greg</dc:creator>
		<pubDate>Mon, 11 Jan 2010 17:27:00 +0000</pubDate>
		<guid isPermaLink="false">http://ditio.net/?p=163#comment-31067</guid>
		<description>Hehehe, thanks @Charles, i will update the article when i will have some time.</description>
		<content:encoded><![CDATA[<p>Hehehe, thanks @Charles, i will update the article when i will have some time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles</title>
		<link>http://ditio.net/2008/12/01/php-xpath-tutorial-advanced-xml-part-1/comment-page-1/#comment-31065</link>
		<dc:creator>Charles</dc:creator>
		<pubDate>Mon, 11 Jan 2010 16:57:07 +0000</pubDate>
		<guid isPermaLink="false">http://ditio.net/?p=163#comment-31065</guid>
		<description>Your English jammed my brain.  I fixed it for you.

...

A few years back when I first read book about XML I could not understand what the hype was all about.  It was some markup language that stores data in well organized way. I also remember parsing XML files in PHP a few years back. The whole file was read using fread() and then a programmer had to create some kind of parser to process XML file.  IT was completely ridiculous. Sure ActionScript, probably Java and some other languages already had classes for parsing XML files, but that was not the case for PHP.  So I thought that this was a technology that did not deserve a second look.

Fast Forward to today.  I read an article covering interesting XML features like XPath, XPoiner, XInclude nad XSLT. Today, I want to introduce you to one of them: XPath. I guess it’s name reveals what it is all about. Basically XPath is a language that allows to localize and fetch information from an XML tree.

First we need a basic XML document, nothing too complicated but nothing too simple either, to show the power of XPath.</description>
		<content:encoded><![CDATA[<p>Your English jammed my brain.  I fixed it for you.</p>
<p>&#8230;</p>
<p>A few years back when I first read book about XML I could not understand what the hype was all about.  It was some markup language that stores data in well organized way. I also remember parsing XML files in PHP a few years back. The whole file was read using fread() and then a programmer had to create some kind of parser to process XML file.  IT was completely ridiculous. Sure ActionScript, probably Java and some other languages already had classes for parsing XML files, but that was not the case for PHP.  So I thought that this was a technology that did not deserve a second look.</p>
<p>Fast Forward to today.  I read an article covering interesting XML features like XPath, XPoiner, XInclude nad XSLT. Today, I want to introduce you to one of them: XPath. I guess it’s name reveals what it is all about. Basically XPath is a language that allows to localize and fetch information from an XML tree.</p>
<p>First we need a basic XML document, nothing too complicated but nothing too simple either, to show the power of XPath.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jay</title>
		<link>http://ditio.net/2008/12/01/php-xpath-tutorial-advanced-xml-part-1/comment-page-1/#comment-30848</link>
		<dc:creator>jay</dc:creator>
		<pubDate>Wed, 06 Jan 2010 12:57:28 +0000</pubDate>
		<guid isPermaLink="false">http://ditio.net/?p=163#comment-30848</guid>
		<description>oh man....you did a great job....keep going...</description>
		<content:encoded><![CDATA[<p>oh man&#8230;.you did a great job&#8230;.keep going&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
