# CSS problem in xml

**URL:** <https://forum.kirupa.com/t/css-problem-in-xml/155312>\
**Category:** flash\
**Created:** [July 16, 2005, 6:20am UTC](https://forum.kirupa.com/t/css-problem-in-xml/155312 "2005-07-16T06:20:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zeemanish](https://avatars.discourse-cdn.com/v4/letter/z/439d5e/32.png) [@zeemanish](https://forum.kirupa.com/u/zeemanish)\
**Post date:** [July 16, 2005, 6:20am UTC](https://forum.kirupa.com/t/css-problem-in-xml/155312/1 "2005-07-16T06:20:36Z")

</div>

hi All,  
i am trying the use CSS on XML but it’s not working .please tell where i am wrong. i am displaying a data in textArea componet.

thanks  
// xml file is here  
\<cities\>  
\<delhi\>  
\<Acolony areaName=“Alaknanda”\>  
\<span class=‘one’\>Batra Dept.\</span\>  
\<two\>Modern Store\</two\>  
\<three\>ShriKamalMedicos\</three\>  
\</Acolony\>  
\<Acolony areaName=“Amar Colony”\>  
\<one\>Sham Store\</one\>  
\<two\>Narang Store\</two\>  
\<three\>Home Need\</three\>  
\<four\>Pawan Stores\</four\>  
\<five\>standard stores\</five\>  
\</Acolony\>  
\<Acolony areaName=“Ashram”\>  
\<one\>H.P. Speed Mart\</one\>  
\<two\>V.K. general Store\</two\>  
\<three\>Delhi Fruit\</three\>  
\<four\>J.P. Store\</four\>  
\</Acolony\>

```
&lt;/delhi&gt;

```

\</cities\>

// css file is here  
Acolony {  
color: #0000FF;  
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;  
font-size: 30px;  
font-weight: normal;

}  
one {  
font-family: Arial, Helvetica, sans-serif;  
font-size: 18px;  
font-weight: bold;  
color: #396780;  
}

// Action Script Code What i am using

stop();

//init TextArea component  
area\_txt.wordWrap = true;  
area\_txt.multiline = true;  
area\_txt.html=true;  
area\_txt.editable=false;

// html Format and CSS call  
colorStyle = new TextField.StyleSheet();  
colorStyle.load(“color.css”);  
area\_txt.styleSheet = colorStyle;

// XML DATA Load  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.load(“soydaystore1.xml”);  
xmlData.onLoad =xmlLoad;  
function xmlLoad(loaded)  
{  
/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Kriupa Forum code it’s Working  
if (loaded) {  
var cityNodes:Array = this.firstChild.childNodes;  
var delhiNodes:Array = cityNodes[0].childNodes;  
for (var i = 0; i \< delhiNodes.length; i++) {  
//trace("----------");  
var acolony:Array = delhiNodes\*.childNodes;  
for (var n = 0; n \< acolony.length; n++) {  
trace(acolony[n].nodeName + " = " + acolony[n].firstChild);  
area\_txt.text=acolony[n].nodeName + " = " + acolony[n].firstChild;  
}  
}  
}  
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* \*/  
if (loaded) {  
xmlNode = this.firstChild;  
totalChild=xmlNode.childNodes[0].childNodes.length;

```
    for(i=0;i&lt;totalChild;i++)
    {
        area_txt.text+=xmlNode.childNodes[0].childNodes*.attributes.areaName+"

```

“;  
totalsubChild=xmlNode.childNodes[0].childNodes\*.childNodes.length;  
for(k=0;k\<totalsubChild;k++)  
{  
area\_txt.text+=” “+xmlNode.childNodes[0].childNodes\*.childNodes[k].firstChild+”  
";  
}  
}  
//firstImage();  
}  
else {  
content = “file not loaded!”;  
}  
}
