IE10, 11 CDATA with hyphens parsed wrong

I experienced such problem: when trying to parse xml that I receive from server, messages contained in CDATA blocks are parsed in IE10, 11 till first hyphens found.

See example of XML that I received:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
      <div class="jq_results_container_outer">
        <div class="jq-msg-alert-0">
      </div><br />]]>

And when I called such Javascript code in IE 10, 11 var data = response.getElementsByTagName('finish_msg')[0] I get data equals to <div class="jq_results_container_outer"><div class="jq

Everything works for FF, Chrome, Opera, IE 8, 9. Thanks



Have a look at this bug submission to IE11:

It appears the bug is fixed in Edge and IE11 (11.0.10240.16431), but for me I still get the bug on IE11.

The bug can be summarized:

new DOMParser().parseFromString('<tag><![CDATA[data-with-hyphen]]></tag>', 'text/xml').firstChild.firstChild.nodeValue;

The result will have a truncated value located at the first occurrence of a hyphen.

Edit: As a workaround, you can retrieve the contents using this format:



Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.