| View previous topic :: View next topic |
| Author |
Message |
Pucek
Joined: 28 Apr 2007 Posts: 4
|
Posted: Sat Apr 28, 2007 12:18 pm Post subject: [PEAR] XML_RSS class drop < and > |
|
|
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 |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1000
|
Posted: Sat Apr 28, 2007 1:13 pm Post subject: |
|
|
| 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. <br>. |
|
| Back to top |
|
 |
Pucek
Joined: 28 Apr 2007 Posts: 4
|
Posted: Sat Apr 28, 2007 1:40 pm Post subject: |
|
|
| 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 |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1000
|
Posted: Sat Apr 28, 2007 2:12 pm Post subject: |
|
|
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 |
|
 |
Pucek
Joined: 28 Apr 2007 Posts: 4
|
|
| Back to top |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1000
|
Posted: Sat Apr 28, 2007 3:00 pm Post subject: |
|
|
| 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 |
|
 |
Pucek
Joined: 28 Apr 2007 Posts: 4
|
Posted: Sat Apr 28, 2007 5:02 pm Post subject: |
|
|
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 |
|
 |
|