as3hx
as3hx copied to clipboard
Error parsing FastXml.parse xml with doctype and parsed character data type nodes
trafficstars
Xml for example:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE connection-config SYSTEM "http://www.game.ru/xml/cc/connection-config.dtd">
<connection-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.game.ru/xml/cc/connection-config.xsd">
<connection-entry type="game" host="game.ru" ports="14444" description="test-server" />
<config-entry type="game" money5="enable" shmup="disable" />
</connection-config>
FastXml.hx fix:
public static function parse(s:String) : FastXML {
var x = Xml.parse(s);
if(x != null)
for(node in x) {
if( node.nodeType == Xml.Document || node.nodeType == Xml.Element )
return new FastXML(node);
}
return null;
}