When parsing an xmlstring, the \r\n is lost. How to solve that?
//Example
var string = "<x y=\"line1\r\nline2\"></x>",
xml = $.parseXML(string),
y = xml.documentElement.getAttribute("y");
//Now y is missing the \r\n.
When parsing an xmlstring, the \r\n is lost. How to solve that?
//Example
var string = "<x y=\"line1\r\nline2\"></x>",
xml = $.parseXML(string),
y = xml.documentElement.getAttribute("y");
//Now y is missing the \r\n.
A line break in an attribute value is meaningless.
<foo bar="line1
line2" />
is really equivalent to:
<foo bar="line1 line2" />
Encode your attribute value like this instead:
<foo bar="line1
line2" />