Name: Anonymous 2007-10-18 20:28
Okay, I don't know wtf is going on anymore. I was working on a feed reader and got it working, but as soon as I test a lengthier, real-life feed, it fails. Take for example this feed:
<entry xml:base='When/200x/2005/11/30/'>
<title>On “Beyond Java”</title>
<link href='On-Beyond-Java' />
<id>http://www.tbray.org/ongoing/When/200x/2005/11/30/On-Beyond-Java</id>;
<published>2005-11-30T12:00:00-08:00</published>
<updated>2005-11-30T15:52:41-08:00</updated>
<category scheme='http://www.tbray.org/ongoing/What/' term='Technology/Java' />
<category scheme='http://www.tbray.org/ongoing/What/' term='Technology' />
<category scheme='http://www.tbray.org/ongoing/What/' term='Java' />
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<p>I just got around to reading Bruce Tate
<a href="http://www.oreilly.com/catalog/beyondjava/">Beyond Java</a>.
</p>
</div>
</content>
</entry>
To get the title I did $xml->entry[$i]->title, which works on this.
But if I try to retrieve the content: $entry->content->asXML(); nothing shows up (which for some weird reason works with the simple version)
The only difference I see between the two are extra tags that don't change the nesting, and single quotes instead of double, which I don't think changes much...
Simple Version:
<entry>
<title>Test entry #4</title>
<id>http://example.org/article4</id>;
<updated>2006-10-03T14:14:34Z</updated>
<link href="http://example.org/article4" />
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml"><p>This is also <em>very</em> exciting.</p>
<p>Yes, it is.</p></div>
</content>
</entry>
<entry xml:base='When/200x/2005/11/30/'>
<title>On “Beyond Java”</title>
<link href='On-Beyond-Java' />
<id>http://www.tbray.org/ongoing/When/200x/2005/11/30/On-Beyond-Java</id>;
<published>2005-11-30T12:00:00-08:00</published>
<updated>2005-11-30T15:52:41-08:00</updated>
<category scheme='http://www.tbray.org/ongoing/What/' term='Technology/Java' />
<category scheme='http://www.tbray.org/ongoing/What/' term='Technology' />
<category scheme='http://www.tbray.org/ongoing/What/' term='Java' />
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<p>I just got around to reading Bruce Tate
<a href="http://www.oreilly.com/catalog/beyondjava/">Beyond Java</a>.
</p>
</div>
</content>
</entry>
To get the title I did $xml->entry[$i]->title, which works on this.
But if I try to retrieve the content: $entry->content->asXML(); nothing shows up (which for some weird reason works with the simple version)
The only difference I see between the two are extra tags that don't change the nesting, and single quotes instead of double, which I don't think changes much...
Simple Version:
<entry>
<title>Test entry #4</title>
<id>http://example.org/article4</id>;
<updated>2006-10-03T14:14:34Z</updated>
<link href="http://example.org/article4" />
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml"><p>This is also <em>very</em> exciting.</p>
<p>Yes, it is.</p></div>
</content>
</entry>