<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: Swhitley's Code Snippets</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Thu, 24 Jul 2008 04:37:53 GMT</pubDate>
    <description>DZone Snippets: Swhitley's Code Snippets</description>
    <item>
      <title>Load PRX document and display elements</title>
      <link>http://snippets.dzone.com/posts/show/5250</link>
      <description>&lt;code&gt;&lt;br /&gt;//Using a simple curl library (not shown) to get xml text&lt;br /&gt;$curl = new CURL();&lt;br /&gt;//$prx contains the url of a PRX document (e.g. http://www.prxbuilder.com/link.aspx?p=1)&lt;br /&gt;$xml = $curl-&gt;get($prx);&lt;br /&gt;&lt;br /&gt;//Load the XML file&lt;br /&gt;$doc = new DOMDocument();&lt;br /&gt;$doc-&gt;loadXML($xml);&lt;br /&gt;&lt;br /&gt;//Retrieve specific PRX elements (subheadline, dateline, body)&lt;br /&gt;$subheadline = $doc-&gt;getElementsByTagName('subheadline')-&gt;item(0)-&gt;nodeValue;&lt;br /&gt;$dateline = $doc-&gt;getElementsByTagName('dateline')-&gt;item(0)-&gt;nodeValue;&lt;br /&gt;$body = $doc-&gt;getElementsByTagName('body')-&gt;item(0)-&gt;nodeValue;&lt;br /&gt;&lt;br /&gt;//Format and display - apply_filters is a WP function.&lt;br /&gt;$content = '&lt;p&gt;'.$subheadline.'&lt;/p&gt;';&lt;br /&gt;$content .= '&lt;p&gt;'.$dateline.'&lt;/p&gt;';&lt;br /&gt;$content .= '&lt;p&gt;'.$body.'&lt;/p&gt;';&lt;br /&gt;$content = apply_filters('the_content_rss', $content);&lt;br /&gt;$content = str_replace(']]&gt;', ']]&amp;gt;', $content);&lt;br /&gt;&lt;br /&gt;echo $content;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 18 Mar 2008 16:59:03 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5250</guid>
      <author>swhitley (Shannon Whitley)</author>
    </item>
    <item>
      <title>Load PRX document and display elements</title>
      <link>http://snippets.dzone.com/posts/show/5249</link>
      <description>&lt;code&gt;&lt;br /&gt;//Using a simple curl library (not shown) to get xml text&lt;br /&gt;$curl = new CURL();&lt;br /&gt;//$prx contains the url of a PRX document (e.g. http://www.prxbuilder.com/link.aspx?p=1)&lt;br /&gt;$xml = $curl-&gt;get($prx);&lt;br /&gt;&lt;br /&gt;//Load the XML file&lt;br /&gt;$doc = new DOMDocument();&lt;br /&gt;$doc-&gt;loadXML($xml);&lt;br /&gt;&lt;br /&gt;//Retrieve specific PRX elements (subheadline, dateline, body)&lt;br /&gt;$subheadline = $doc-&gt;getElementsByTagName('subheadline')-&gt;item(0)-&gt;nodeValue;&lt;br /&gt;$dateline = $doc-&gt;getElementsByTagName('dateline')-&gt;item(0)-&gt;nodeValue;&lt;br /&gt;$body = $doc-&gt;getElementsByTagName('body')-&gt;item(0)-&gt;nodeValue;&lt;br /&gt;&lt;br /&gt;//Format and display - apply_filters is a WP function.&lt;br /&gt;$content = '&lt;p&gt;'.$subheadline.'&lt;/p&gt;';&lt;br /&gt;$content .= '&lt;p&gt;'.$dateline.'&lt;/p&gt;';&lt;br /&gt;$content .= '&lt;p&gt;'.$body.'&lt;/p&gt;';&lt;br /&gt;$content = apply_filters('the_content_rss', $content);&lt;br /&gt;$content = str_replace(']]&gt;', ']]&amp;gt;', $content);&lt;br /&gt;&lt;br /&gt;echo $content;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 18 Mar 2008 16:57:00 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5249</guid>
      <author>swhitley (Shannon Whitley)</author>
    </item>
  </channel>
</rss>
