Groups | Blog | Home
all groups > dotnet xml > september 2004 >

dotnet xml : customize xml created from dataset


Andrew
9/20/2004 11:14:11 AM
hi,
i've successfully write my xml from a dataset schema ....
thanks for support ...
now i need to set properly this parameters ...

<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE anagrafica-prestazioni (View Source for full doctype...)>

how can i add this line considering i'm writing the xml froma dataset , with
a ds.writelxml
method ???
thanks ...
andrew


Martin Honnen
9/20/2004 6:28:09 PM


[quoted text, click to view]


[quoted text, click to view]

You can create an XmlTextWriter with the intended encoding e.g.
XmlTextWriter xmlWriter = new XmlTextWriter(filename,
System.Text.Encoding.GetEncoding("ISO-8859-1")
and then pass that xmlWriter to the WriteXml method, that way you should
get the XML declaration e.g.
<?xml version="1.0" encoding="iso-8859-1" ?>
at the start of the document.
--

Martin Honnen
AddThis Social Bookmark Button