0

Lets assume I got some xml code pasted into a contenteditable div. I am now retrieving the text (xml) from the div via jQuery's .text() function and then input it into jquery's parseXML() function. It works everywhere except Firefox which always says not well formed xml? Pasting the exact same xml code via i.e. a js prompt() with the same code works just perfectly fine. Is this a bug and if so, what could I do about that?

  • `contenteditable` is to edit _HTML_. So it is likely that some browsers perform some kind of “error correction”, when trying to _interpret_ your copy&pasted XML content _as_ HTML. Only after that has happened, you are retrieving the text content of the editable element (which will of course not be what you input any more, but the browser’s re-created textual representation of DOM content) – have you made a debug output to see what it looks like? – CBroe Jan 28 '16 at 18:57
  • Yes of course ;) And the debug output on console looks 100% same like the content I get from the prompt so its really nonsense for me. Furthermore, this works perfectly on Chrome but not in FF!? – Alexander Adam Jan 29 '16 at 09:01

0 Answers0