PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
[PEAR] XML_RSS class drop < and >

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> PEAR
View previous topic :: View next topic  
Author Message
Pucek



Joined: 28 Apr 2007
Posts: 4

PostPosted: Sat Apr 28, 2007 12:18 pm    Post subject: [PEAR] XML_RSS class drop < and > Reply with quote

Anyone knows is there an option which I can make ->parse() method to dont drop < and > becouse when i parse description from a channel, where is for example <p> </p> <a> <img... i get only 'p' '/p' 'a' 'img ...' thats annoying i cant make anything with it...


This is a problem, and i want to drop all html tags or make class to dont dissapear '<' and '>' anyone know what can i do?

I figured that ->parse(); method change it, and its connected with made parser... plz help
_________________
http://testwiedzy.pl
http://mindflow.pl
http://kimjestes.pl
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1235

PostPosted: Sat Apr 28, 2007 1:13 pm    Post subject: Reply with quote

Please post an example of such a feed. Does this feed contain something like <content>bla<br>bla</content> (with <content> being a XML tag)? That would be a broken feed, the <br> should be written as e.g. &lt;br&gt;.
Back to top
View user's profile Send private message
Pucek



Joined: 28 Apr 2007
Posts: 4

PostPosted: Sat Apr 28, 2007 1:40 pm    Post subject: Reply with quote

Code:


$rss =& new XML_RSS( 'http://wortal.php.pl/rss/feed/nowosci' );

$rss->parse();

foreach ($rss->getItems() as $item) {
 
   echo $item['description'];

}



Example:

Code:
 

<description>

    <p>Lorem ipsum  Lorem ipsum  Lorem ipsum   <img src="x.jpg" />
    Lorem ipsum  Lorem ipsum  <b>TUTU</b> Lorem ipsum  Lorem ipsum 
    </p>

</description>



I get :

Code:


    p Lorem ipsum  Lorem ipsum  Lorem ipsum   img src="x.jpg" /
    Lorem ipsum  Lorem ipsum  b TUTU /b Lorem ipsum  Lorem ipsum 
    /p



And i want no html tags or with < > but no middle compromise.

ALl in all when i open this feed in etc. google reader it is great parset, only without images, but other html tags as <p> <br> .... are on their place...
_________________
http://testwiedzy.pl
http://mindflow.pl
http://kimjestes.pl
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1235

PostPosted: Sat Apr 28, 2007 2:12 pm    Post subject: Reply with quote

Your example works here. E.g., I get something like
Code:
<p>
W pogoni za niezmiernie rosnącą popularnością oraz zapotrzebowaniami użytkowników, powstał serwis Polskiej Społeczności Zend Framework. W gwoli przypomnienia chciałbym poinformować, że dostępna jest już jego pierwsza beta.<br />
</p>
as the first result of your foreach() loop.

Do you have the latest versions of XML_RSS and XML_Parser installed?
Back to top
View user's profile Send private message
Pucek



Joined: 28 Apr 2007
Posts: 4

PostPosted: Sat Apr 28, 2007 2:37 pm    Post subject: Reply with quote

I have windows pear 1.5.3 and XML_RSS package ver. 0.9.2 and xml_parser 1.2.8
_________________
http://testwiedzy.pl
http://mindflow.pl
http://kimjestes.pl
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1235

PostPosted: Sat Apr 28, 2007 3:00 pm    Post subject: Reply with quote

Pucek wrote:
I have windows pear 1.5.3 and XML_RSS package ver. 0.9.2 and xml_parser 1.2.8


Please try the latest XML_RSS version, it is 0.9.10. I have 0.9.9 installed (too lazy for updating now *g*) and get the expected result.
Back to top
View user's profile Send private message
Pucek



Joined: 28 Apr 2007
Posts: 4

PostPosted: Sat Apr 28, 2007 5:02 pm    Post subject: Reply with quote

crap doesnt work, maybe i have some problems with files, but maybe i dont have other files?


INSTALLED PACKAGES, CHANNEL PEAR.PH
===================================
PACKAGE VERSION STATE
Archive_Tar 1.3.2 stable
Console_Getopt 1.2.2 stable
MDB2 2.4.0 stable
PEAR 1.5.3 stable
Structures_Graph 1.0.2 stable
XML_Parser 1.2.8 stable
XML_RSS 0.9.9 beta
XML_Tree 1.1 stable
_________________
http://testwiedzy.pl
http://mindflow.pl
http://kimjestes.pl
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> PEAR All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement