add xml version line before xml file root node

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, All,

I try to add xml version line(<?xml version="1.0" encoding="utf-8"?>) before
xml file AutoData root node in the following file

<AutoData >
<Table1>
<Data1> 10 </Data1>
<Data2> 20 </Data2>
<Data3> 40 </Data3>
<Table1>
</AutoData>

So finally the file is like this:

(<?xml version="1.0" encoding="utf-8"?>)
<AutoData >
<Table1>
<Data1> 10 </Data1>
<Data2> 20 </Data2>
<Data3> 40 </Data3>
<Table1>
</AutoData>

Anyone knows how to add it?

Thanks
Martin
 
martin1 said:
I try to add xml version line(<?xml version="1.0" encoding="utf-8"?>) before
xml file AutoData root node in the following file

When you serialize/save the XML document use the proper
XmlWriterSettings with .NET 2.0.
 
Back
Top