A ver, que me he releido y no me he parecido muy claro lo que te contaba, a
ver si con un poco de c�digo...
Cuidado con los saltos de l�nea.
<code>
//-------------------------------------
function parserNoticia(){
trace("parserNoticia");
 _global.noticias = new Object();
 declaracion = this.firstChild;// contiene el objeto XML entero

  for (i=0; i<declaracion.childNodes.length; i++) {
   noticias = declaracion.childNodes[i];// nodo principal
   noticiaId = noticias.attributes.id;
   titulo = noticias.firstChild.lastChild.toString();
   fecha = noticias.firstChild.nextSibling.lastChild.toString();
   descripcion =
 noticias.firstChild.nextSibling.nextSibling.lastChild.toString();

   _global.noticias["noticia" + i] = new noticia(titulo, fecha, noticiaId,
 descripcion);

   _global.noticias._numeroNoticia = 0;//indica en numero de pantalla en que
 estamos. Comienza en cero.
 //  _global.noticias._totalNoticias = Number
 (noticias.attributes.id);//numero total de pantallas
   _global.noticias._totalNoticias = Number
 (declaracion.childNodes.length);//numero total de pantallas
  }// fin for

 // borra los objetos XML
  delete XML_ob;
  delete declaracion;
  delete noticias;
  delete noticiaId;
  delete titulo;
  delete fecha;
  delete descripcion;
 }
 </code>

 Y la noticia del xml es tal que as�:
 <noticia id="7">
  <titulo><![CDATA[<FONT SIZE='8' COLOR='#9EADB6' FACE='textos'>ENTREVISTA
EN
 LA RADIO<br/></FONT>]]></titulo>
  <fecha><![CDATA[<FONT SIZE='8' COLOR='#FFFFFF'
 FACE='textos'>27/01/2004</FONT>]]></fecha>
  <descripcion><![CDATA[<FONT SIZE='8' COLOR='#FFFFFF'
FACE='textos'>Acabamos
 de actualizar contenidos en la secci�n de descargas, hab�a un tema que no
se
 pod�a bajar (Ruby Paradise), y tambi�n hemos colgado un MP3 con la <a
 href="http://www.cujo.biz/MP3/entrevista_cujo.zip"; target="_blank"><u><FONT
 COLOR='#9EADB6'>entrevista completa</FONT></u></a></FONT>]]></descripcion>
 </noticia>


 Paulo.

 PD: yo estoy con gripe, s� que es off topic, pero parece que interesa el
 tema de los virus 8-).





<!-------------------------------
Lista ASNativos:
subscripciones/desubscripciones
http://www.sidedev.net/asnativos
-------------------------------->

Responder a