Because I'm working with a project that creates a XML file.
The encoding is required to be "ISO-8859-1". Next, it is requiret that the
characters @ < > & ' " does not occur in the data in the file and must be
escaped by the values (respectively) &at; < > & ' "
I'm writing the XMLDocument using a XmlTextWriter with the encoding set to
ISO-8859-1.
The encoding does not handle theese character escapings (it does handle
escaping of &, which destroys my tries to do a search and replace of the
characters).
I've managed to solve it by using the WriteRaw method of the XmlTextWriter,
but this forces me to use the XmlTextWriter object constantly instead of
adding nodes to the XmlDocument instance and then writing this instance to a
file using the XmlTextWriter object.
Benny
"Oleg Tkachenko [MVP]" <oleg@NO!SPAM!PLEASEtkachenko.com> skrev i en
meddelelse news:u3**************@tk2msftngp13.phx.gbl...
Benny Tordrup wrote:
Is it possible to make the XmlTextWriter escape other characters
(especially @, >, ' and ")?
I don't think so. Why?
--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com