Save attribute value of xml element with single quotes using linq for xml

How do I make an XDocument object save the value of an attribute of an element with single quotes?

+3
source share
3 answers

If it is absolutely necessary to have single quotes, you can write your XML document to a string, and then use string substitution to go from single to double quotes.

0
source

I'm not sure that any LINQ to XML formatting options allow you to specify this. Why do you need this? This is a pretty bad kind of XML handler that will take care of this ...

+1
source

, XML- , . , XML- , (, , XML). , , . , sed grep XML, . - , XML , XML, , XML. , , XML, XML.

If you cannot do this, then JacobE's offer is likely to be your best bet.

+1
source

Source: https://habr.com/ru/post/1698530/


All Articles