Home All Groups Group Topic Archive Search About

add xml version line before xml file root node

Author
9 Nov 2006 3:51 PM
martin1
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

Author
9 Nov 2006 5:05 PM
Martin Honnen
martin1 wrote:

> 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.

--

    Martin Honnen --- MVP XML
    http://JavaScript.FAQTs.com/
Author
9 Nov 2006 6:02 PM
martin1
Thank you so much. Martin

Show quoteHide quote
"Martin Honnen" wrote:

> martin1 wrote:
>
> > 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.
>
> --
>
>     Martin Honnen --- MVP XML
>     http://JavaScript.FAQTs.com/
>