<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>bojan.blog &#187; xpath</title>
	<atom:link href="http://bojand.org/blog/tag/xpath/feed" rel="self" type="application/rss+xml" />
	<link>http://bojand.org/blog</link>
	<description></description>
	<lastBuildDate>Sun, 11 Apr 2010 04:03:46 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>XML parsing with Perl using XPath</title>
		<link>http://bojand.org/blog/68.html</link>
		<comments>http://bojand.org/blog/68.html#comments</comments>
		<pubDate>Mon, 21 Aug 2006 22:01:43 +0000</pubDate>
		<dc:creator>Bojan</dc:creator>
				<category><![CDATA[Data Processing]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xpath]]></category>

		<guid isPermaLink="false">http://bojan.info/blog/?p=68</guid>
		<description><![CDATA[
use strict;
use XML::LibXML;

# data source
my $xml_filename = &#34;xml/data.xml&#34;;

my $parser = XML::LibXML-&#62;new;
my $doc = $parser-&#62;parse_file($xml_filename);

my $xpath = &#34;//word/entry[\@src=\&#34;pr\&#34;]/..&#34;;
my @words = $doc-&#62;findnodes($xpath);

foreach my $word (@words) {
	print $word-&#62;findvalue(&#34;\@id&#34;);
	print &#34;\n&#34;;
}

]]></description>
			<content:encoded><![CDATA[<pre class="brush: perl;">
use strict;
use XML::LibXML;

# data source
my $xml_filename = &quot;xml/data.xml&quot;;

my $parser = XML::LibXML-&gt;new;
my $doc = $parser-&gt;parse_file($xml_filename);

my $xpath = &quot;//word/entry[\@src=\&quot;pr\&quot;]/..&quot;;
my @words = $doc-&gt;findnodes($xpath);

foreach my $word (@words) {
	print $word-&gt;findvalue(&quot;\@id&quot;);
	print &quot;\n&quot;;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://bojand.org/blog/68.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
