#24392 [NEW]: simplexml failure on slashdot.rdf
| From: | shane@php.net | Date: | Mon, 30 Jun 2003 00:22:55 +0000 |
| Subject: | #24392 [NEW]: simplexml failure on slashdot.rdf | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-42763@lists.php.net to get a copy of this message | ||
From: shane@php.net
Operating system: win32
PHP version: 5CVS-2003-06-29 (dev)
PHP Bug Type: XML related
Bug description: simplexml failure on slashdot.rdf
Description:
------------
Sometimes simplexml objects return empty strings, even though var_dump
shows the strings. A simple example is using simplexml to parse rdf. I
grabbed an rdf from phpbuilder.com, and it worked wonderfully. Grabbed
one from slashdot, and failure.
Reproduce code:
---------------
grab slashdot rdf
http://slashdot.org/slashdot.rdf
parse with:
<?php
$rdf = simplexml_load_file('slashdot.rdf');
?>
<table border="1" cellspacing="0" cellpadding="0"
bordercolor="#0000FF">
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="4">
<tr>
<td style="background-color:blue; color:white;"><?php echo
$rdf->channel->title; ?></td>
</tr>
<?php
foreach ($rdf->item as $item) {
// this dump shows the correct data, but emptiness below
// var_dump($item);
?>
<tr>
<td>
<a href="<?php echo $item->link; ?>"><?php echo $item->title;
?></a>
</td>
</tr>
<?php } ?>
</table>
</td>
</tr>
</table>
--
Edit bug report at http://bugs.php.net/?id=24392&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=24392&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=24392&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=24392&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=24392&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=24392&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=24392&r=support
Expected behavior: http://bugs.php.net/fix.php?id=24392&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=24392&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=24392&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=24392&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24392&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=24392&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=24392&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=24392&r=gnused