0

I have tried to put line break between my specific XML attribute, but with no success so far.

Basically, I need something like this:

<root>
    <someValue myAttrib="valueOne"
               anotherAttrib="valueTwo" />
</root>

I made some tests using XDocument class, but it does not worked.

Thanks in advance.

What I have tested so far (the commented lines doesn't work):

var document = XDocument.Parse("<root></root>");

var xml = new XElement("someValue",
    new XAttribute("myAttrib", "valueOne"),
    //new XAttribute("&#xA", ""),
    //new XAttribute("\r\n", ""),
    new XAttribute("anotherAttrib", "valueTwo")
    );
Warvimo
  • 35
  • 8

0 Answers0