[haXe] xml parsing

Nicolas Cannasse ncannasse at motion-twin.com
Tue Apr 25 14:08:39 CEST 2006


> could anyone tell me what's wrong with this code:
> 
> class XmlTest{
> 	static public function main(){
> 	 var s= XmlParser.parse(Std.resource("myxml"));
> 	 for(i in 0...s.childNodes)
> 		trace(s.childNodes[i]);
> 	 }
> }
> 
> the error is:
> Array<Node> should be Int
> 
> thanks for any help
> cornel

for( i in 0...s.childNodes.length )
    trace(s.childNodes[i]);

-OR (equivalent)-

for( c in s.childNodes )
    trace(c);

Nicolas



More information about the Haxe mailing list