class Main extends Sprite
{
public function new()
{
super();
try
{
var xml:Xml = Xml.parse("<count>6</count>");
trace(xml.nodeType);
for (x in xml.elementsNamed("count"))
{
trace(x.nodeName);
trace(x.nodeType);
trace(x.nodeValue);
}
}
catch (err:Dynamic)
{
trace(err);
Sys.exit(1);
}
}
}
Output:
Main.hx:23: 6
Main.hx:27: count
Main.hx:28: 0
Main.hx:34: Bad node type, unexpected 0
I can't fully understand the principle of operation of nodeValue
property. Because of that, I can't solve my problem. Any help here?
P.S. My configuration is: Haxe + OpenFL targeting Neko.