Game Development Community

How Do You Read an XML File?

by practicing01 · in Torque 2D Beginner · 02/06/2014 (9:45 am) · 2 replies

I'm trying this and the load is returning true but it's not showing any values. Has anyone had success with the xml functions?

%XML_Document=new SimXMLDocument();

echo("loadFile():" SPC %XML_Document.loadFile(expandPath("./Hiragana.fnt")));

%String_Attribute=%XML_Document.firstAttribute();

echo("firstAttribute():" SPC %String_Attribute);

while (%String_Attribute!$="")
{

%String_Attribute=%XML_Document.nextAttribute();

echo("nextAttribute():" SPC %String_Attribute);

}

#1
02/08/2014 (6:21 am)
Did you figure this out yet?
#2
02/08/2014 (7:37 am)
I remember seeing others having problems with XML - the XML reader might be bugged. I'd compare the XML reader from T2D with T3D's - it is what the TAML system is based on and might be in better shape.