-
-
Notifications
You must be signed in to change notification settings - Fork 5
XML API
Nenkai edited this page Jul 14, 2024
·
3 revisions
Warning
This API was introduced after GT4.
// Load xml from source
var xml = main::pdistd::MXml();
xml.parse(xml_data);
// Navigate/Iterate through nodes
var dom = xml.result;
var xml_nodes = dom[node_name];
foreach (var node in xml_nodes)
{
// ...
}
var xml_node = pdistd::MDomNode();
// xml_node.addNode(name, node);
// xml_node.addAttribute(name, node);
var xml_head = "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>\n";
var xml_data = xml_node.serialize("xml");
var xml_str = xml_head + xml_data;