LINQ to XML ignores line breaks in attributes

alqaatri

New Member
According to this question:Are line breaks in XML attribute values valid?line breaks in XML attributes are perfectly valid (although perhaps not recommended):\[code\]<xmltag1> <xmltag2 attrib="line 1line 2line 3"> </xmltag2></xmltag1>\[/code\]When I parse such XML using LINQ to XML (\[code\]System.Xml.Linq\[/code\]), those line breaks are converted silently to space \[code\]' '\[/code\] characters.Is there any way to tell the \[code\]XDocument.Load()\[/code\] parser to preserve those line breaks?P.S.: The XML I'm parsing is written by third-party software, so I cannot change the way the line breaks are written.
 
Back
Top