none
XMLHttpRequest responseXML in IE10 converting cdata node text to html entities RRS feed

  • General discussion

  • In an AJAX request when I go to parse the response to a string all html tags are being converted to their xml entities.  

    Ex:

    var childNodes = nodes[i].childNodes;
    for(var j=0; j<childNodes.length; j++) {
    if (window.ActiveXObject && nodes[0] && nodes[0].xml) {
    nodeVal += childNodes[j].xml;
    } else {
    nodeVal += (new XMLSerializer()).serializeToString(childNodes[j]);
    }
    }

    The value of childNodes[j] is:

    <![CDATA[<span>this is a test</span>]]>

    but once it has been serialized to a string the value is:

    &lt;span&gt;this is a test&lt;/span&gt;

    Also notice that the cdata tags were removed.  This works fine in all other browsers and was working fine in IE10 release preview on windows 7 but now that I have the full version of IE10 on windows 7 this is happening.  

    I'm assuming this is a bug and is there a work around for it?

    Friday, March 1, 2013 8:09 PM

All replies

  • Hi,

    http://connect.microsoft.com/ie

    Regards.


    Rob^_^

    Saturday, March 2, 2013 12:18 AM
  • Rob,

    I'm assuming you are pointing me to this site to leave feedback, but does anyone know of a workaround currently for this issue?

    Thanks,

    Brant

    Saturday, March 2, 2013 4:03 AM
  • Hi Brant,


    As Rob listed, you can submit a feedback via the following link:

    http://connect.microsoft.com/IE


    Thanks,


    Vincent Wang
    TechNet Community Support

    Tuesday, March 5, 2013 3:18 AM
    Moderator
  • Hi Brant,

    You could try adding the x-ua IE=5 meta or test if that works by using the Developer tool to toggle the Document Mode back to IE5 Quirks....

    I may have posted such a workaround on a similar issue that's already been posted on connect, that involved xhtml in a Quirks document.

    Its a bit hard to tell a workaround without the full markup....IE10 has two Quirks mode.... IE10 Quirks (aka W3c Compliance checker mode.. which doesn't care about a DTD (except for a large exception list) and renders in a css Backcompat mode...(viz IE10 full featured)) and IE5 Quirks mode... (really the only Quirks mode).. which only recognizes css 1.1.

    Questions about html, css and scripting should be posted in the first instance to the IE Web Development forum (with a link to your website... or mashup... we need to see not only the full markup but also your server response headers).

    http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/threads

    (I probably told you where to go in the first instance because you did not provide your full markup.... really... the quality of our answers depends upon the quality of your questions.... when it comes to html markup without your FULL markup, we may as well use a crystal ball. The Document type declaration makes all the difference in how browsers render and correct markup errors.)

    or if you want to post a bug or feature request for IE10 post to http://connect.microsoft.com/ie (or we can on your behalf)


    Rob^_^

    Tuesday, March 5, 2013 5:09 AM