Ver Mensaje Individual
  #6 (permalink)  
Antiguo 14/01/2009, 15:33
omarl
 
Fecha de Ingreso: agosto-2005
Mensajes: 83
Antigüedad: 18 años, 8 meses
Puntos: 0
Respuesta: PHP embebido en XML?... ¿como?

gracias a todos por sus respuestas buena gente,hice el sgte codigo

Código PHP:

links.php

<?php
header
('Content-type: text/xml'); 

echo 
'<pages>';

echo 
'<link>
<title>HTML DOM alt Property</title>
<url>http://www.w3schools.com/htmldom/prop_img_alt.asp</url>
</link>'
;

echo 
'<link>
<title>HTML DOM height Property</title>
<url>http://www.w3schools.com/htmldom/prop_img_height.asp</url>
</link>'
;

echo 
'<link>
<title>HTML a tag</title>
<url>http://www.w3schools.com/tags/tag_a.asp</url>
</link>'
;

echo 
'</pages>';
?>
cuando lo veo en el navegador sale como un xml normal

es decir con los colores y todo como un xml normal y correcto

- <pages>
- <link>
<title>HTML DOM alt Property</title>
<url>http://www.w3schools.com/htmldom/prop_img_alt.asp</url>
</link>
- <link>
<title>HTML DOM height Property</title>
<url>http://www.w3schools.com/htmldom/prop_img_height.asp</url>
</link>
- <link>


............



el codigo php desde donde llamo al xml es este

$xmlDoc->load("links.php");$x=$xmlDoc->getElementsByTagName('link');

antes era ovbiamente este

$xmlDoc->load("links.xml");$x=$xmlDoc->getElementsByTagName('link');

si esta el xml en php debo invocarlo de otra manera???


ya que cuando tipeo la palabra en al input sale el siguiente error

Código:
Warning: DOMDocument::load() [function.DOMDocument-load]: Start tag expected, '<' not found in /home/viaweb02/public_html/sistmeec/admin/testing/links.php, line: 47 in /home/viaweb02/public_html/sistmeec/admin/testing/livesearch.php on line 3
no suggestion

el codigo lo saque de esta pagina
http://www.w3schools.com/php/php_ajax_livesearch.asp

me hechan una mano?

mil gracias