By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,167 Members | 1,692 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,167 IT Pros & Developers. It's quick & easy.

XML parsing delirium

P: 4
Hi all!

I'm pretty mad about this... dont know what is going on.

Im parsing XML file that looks like this:

<something>
__<item att="something">text<item>
__<item att="something">text<item>
__<item att="something">text <span class="some">inside text</span> text<item>
</something>

its because "inside text" needs to have other color than text outside span.

im using external css file loaded into flash.

parsing part goes like this:
Expand|Select|Wrap|Line Numbers
  1. function processData(thisXML):Void{
  2.     var titles:Array = new Array();
  3.     var texts:Array = new Array();
  4.     for(var aNode:XMLNode = thisXML.firstChild.firstChild; aNode != null; aNode = aNode.nextSibling){
  5.         titles.push(aNode.attributes.att);
  6.         texts.push(aNode.childNodes);
  7.     }
  8.     trace(texts.length);
  9.     constructData( parameters);
  10. }
  11.  
an here is problem part.... aNode.childNodes gives me part <span class="some">inside text</span>

like this : ,<span class="some">inside text</span>, , yes its adding commas around span part....

if i trace whole xml file, output is without commas... so i assume problem is with childNodes part.

it makes me mad...

i've tried <![CDATA[]]> but it makes same thing and disable styleSheet on it.


need help... thanks
Sep 22 '07 #1
Share this Question
Share on Google+
1 Reply


P: 4
solved...:) used CDATA, and instead of ChildNodes array i used fistChild.nodeValue

bye
Sep 23 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.