É bem simples, existem 3 campos no XML, Titulo da Noticia (Name) + Corpo da Notícia (Description) + Autor (Por)
noticias.xml
<?xml version="1.0" ?><Books> <Book> <Name> Titulo da Notícia 1 </Name> <Description> Corpo da Notícia 1 </Description> <Por>Érico Scorpioni 26 de Junho de 2007 20:42 </Por> </Book> <Book> <Name> Título da Notícia 2 </Name> <Description> Corpo da Notícia 2 </Description> <Por>Érico Scorpioni 26 de Junho de 2007 09:22 </Por> </Book></Books>
e meu AS é:
varXML = new XML();varXML.onLoad = converterXML;varXML.load("noticias.xml");texto.textos = "";function converterXML(){ TagPrincipal = new XML; TagElemento = new XML; books = new Array; elemento = new Array; TagPrincipal = this.firstChild.nextSibling; nodo = TagPrincipal.nodeName.toUpperCase() ; books = TagPrincipal.childNodes; for ( i = 0 ; i < books.length ; i++){ elemento = books[i].childNodes; for(j=0;j<=elemento.length;j++) { Tagelemento = elemento[j]; Tipoelemento = Tagelemento.nodeName.toLowerCase(); if(Tipoelemento == "name"){ texto.textos = texto.textos + Tagelemento.firstChild.nodeValue + "<br>" ; } else { if(Tipoelemento == "description"){ texto.textos = texto.textos + Tagelemento.firstChild.nodeValue + "<br>"; } else { if(Tipoelemento == "por"){ texto.textos = texto.textos + "Por: " + Tagelemento.firstChild.nodeValue + "<br>"; } } } } }}
Quando eu linkei esse CSS (noticias.css)
Name{color: #000000;font-size: 11pt;}Description{color: #666666;font-size: 10pt;}Por{color: #006699;font-size: 8pt;}colocando essa tag no XML
<?xml-stylesheet type="text/css" href="noticias.css"?>Ele nao funcionava mais!
O Flash não aceita XML com CSS?
Existe uma maneira de eu alterar a cor e o tamanho da fonte naquele AS que chama o XML?
Desde já obrigado!