Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/01/2014, 09:00
mktalternativa
 
Fecha de Ingreso: enero-2012
Mensajes: 224
Antigüedad: 12 años, 3 meses
Puntos: 1
Simple Xml php5

Hola como estan estoy queriendo leer un xml con simplexml pero me da este error



Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML


que estoy haciendo mal este es mi codigo

Código PHP:
<?php 
$data 
"http://alerts.weather.gov/cap/tx.php?x=1";
$library file_get_contents($data);
$library = new SimpleXMLElement($library);


echo 
'<table>';
echo 
'<tr>';
echo   
'<th>Title</th>
        <th>Author</th>
        <th>Publisher</th>
        <th>ISBN</th>'
;
echo 
'</tr>';
foreach( 
$library->book as $book ) {
    echo 
'<tr>';
    echo 
'<td>' $book->entry '</td>';
    echo 
'<td>' $book->published '</td>';
    echo 
'<td>' $book->name '</td>';
    echo 
'<td>' $book->title '</td>';
    echo 
'</tr>';
}
echo 
'</table>';


?>