Reply
PHP SimpleXML parser error : Premature end of data in tag feed line 1
Old 07-16-2009, 09:44 AM PHP SimpleXML parser error : Premature end of data in tag feed line 1
Junior Talker

Posts: 1
Trades: 0
Hi.
I'm getting a parser error on my XML feed from YouTube's friend activity feed.
The error I am recieving is:
Quote:
Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: Entity: line 1: parser error : Premature end of data in tag feed line 1 in /media/morpheus/yasn/includes/youtube.php on line 86

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: x>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage> in /media/morpheus/yasn/includes/youtube.php on line 86

Warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: ^ in /media/morpheus/yasn/includes/youtube.php on line 86

Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /media/morpheus/yasn/includes/youtube.php:86 Stack trace: #0 /media/morpheus/yasn/includes/youtube.php(86): SimpleXMLElement->__construct('<feed xmlns='ht...') #1 /media/morpheus/yasn/stream_test.php(70): YouTube->get_friends_activity() #2 {main} thrown in /media/morpheus/yasn/includes/youtube.php on line 86
The content of the XML feed is: (spaced out so easier to read)
HTML Code:
<feed xmlns='http://www.w3.org/2005/Atom'
xmlns:openSearch='http://a9.com/-/spec/opensearch/1.1/'
xmlns:gd='http://schemas.google.com/g/2005'
gd:etag='W/"DUQHQXs6cCp7ImA9WxJUF0k."'>
  <id>
  tag:youtube.com,2008:user:amalcontentiwilson:friendsactivity</id>
  <updated>2009-07-16T05:28:50.518-07:00</updated>
  <category scheme='http://schemas.google.com/g/2005#kind'
  term='http://gdata.youtube.com/schemas/2007#userEvent' />
  <title>Activity of the friends of amalcontentiwilson</title>
  <logo>
  http://www.youtube.com/img/pic_youtubelogo_123x63.gif</logo>
  <link rel='http://schemas.google.com/g/2005#feed'
  type='application/atom+xml'
  href='http://gdata.youtube.com/feeds/api/users/amalcontentiwilson/friendsactivity' />
  <link rel='http://schemas.google.com/g/2005#batch'
  type='application/atom+xml'
  href='http://gdata.youtube.com/feeds/api/users/amalcontentiwilson/friendsactivity/batch' />
  <link rel='self' type='application/atom+xml'
  href='http://gdata.youtube.com/feeds/api/users/amalcontentiwilson/friendsactivity?start-index=1&amp;max-results=25' />
  <link rel='service' type='application/atomsvc+xml'
  href='http://gdata.youtube.com/feeds/api/users/amalcontentiwilson/friendsactivity?alt=atom-service' />
  <author>
    <name>YouTube</name>
    <uri>http://www.youtube.com/</uri>
  </author>
  <generator version='2.0' uri='http://gdata.youtube.com/'>YouTube
  data API</generator>
  <openSearch:totalResults>0</openSearch:totalResults>
  <openSearch:startIndex>1</openSearch:startIndex>
  <openSearch:itemsPerPage>25</openSearch:itemsPerPage>
</feed>
Could someone help me to see why this is not valid and how to solve the problem?
Thanks.
adammw is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 08-10-2009, 10:42 AM Re: PHP SimpleXML parser error : Premature end of data in tag feed line 1
Junior Talker

Posts: 1
Trades: 0
I have the same problem, any ideas?
jcgeilomat is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to PHP SimpleXML parser error : Premature end of data in tag feed line 1
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.10833 seconds with 13 queries