as3hx icon indicating copy to clipboard operation
as3hx copied to clipboard

Error parsing FastXml.parse xml with doctype and parsed character data type nodes

Open k0t0vich opened this issue 7 years ago • 0 comments
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;
    }

k0t0vich avatar Jan 12 '18 11:01 k0t0vich