diff --git a/std/haxe/xml/Parser.hx b/std/haxe/xml/Parser.hx index c5e5d01c513..54f6f77420b 100644 --- a/std/haxe/xml/Parser.hx +++ b/std/haxe/xml/Parser.hx @@ -395,8 +395,10 @@ class Parser { if (parent.nodeType == Element) { throw new XmlParserException("Unclosed node <" + parent.nodeName + ">", str, p); } - if (p != start || nsubs == 0) { + if( p != start ) buf.addSub(str, start, p - start); + var str = buf.toString(); + if (str.length > 0 || nsubs == 0) { addChild(Xml.createPCData(buf.toString())); } return p; diff --git a/std/php/_std/haxe/xml/Parser.hx b/std/php/_std/haxe/xml/Parser.hx index 216a96ec81f..884e0becd8c 100644 --- a/std/php/_std/haxe/xml/Parser.hx +++ b/std/php/_std/haxe/xml/Parser.hx @@ -175,9 +175,8 @@ class Parser { p += 8; state = S.DOCTYPE; start = p + 1; - } else if (str.fastCodeAt(p + 1) != '-'.code || str.fastCodeAt(p + 2) != '-'.code) - throw new XmlParserException("Expected