Groups | Blog | Home
all groups > dotnet xml > november 2003 >

dotnet xml : VS.NET and XML structure


Leszek
11/12/2003 8:50:36 AM
Hello,

Does anybody know how to edit the structure of XML files using VS.NET?
I have an XML file and just need to add an additional column. The file
already has a hundred of records. The only method I know is to go through
all of them and add the appropriate tags manually (or using a trick with
"Find and Replace"). This method is painful and I believe there must be
another one.
Should I use schema or something like that?

Thanks for any hints,
Leszek Taratuta

v-kevy NO[at]SPAM online.microsoft.com
11/13/2003 1:47:26 AM
Hi Leszek,

Based on my understanding, you need to add a column into the XML file.
There're several ways to achieve this, and it depends on how the XML file
is created.

If the XML file is created from an ADO .NET DataSet, you can first read the
XML file into a DataSet using DataSet.ReadXml(), add a column into the
DataSet and then write it back to the XML file. If the XML file is
generated with your own schema, I think you have to load it into an
XmlDocument and go through each record to add column in a loop.

If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

--------------------
| From: "Leszek" <taratuta@5thbusiness.com>
| Subject: VS.NET and XML structure
| Date: Wed, 12 Nov 2003 08:50:36 -0500
| Lines: 14
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
| Message-ID: <uxiCGNSqDHA.3504@TK2MSFTNGP11.phx.gbl>
| Newsgroups: microsoft.public.dotnet.xml
| NNTP-Posting-Host: hse-montreal-ppp135103.qc.sympatico.ca 64.231.246.174
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.xml:17167
| X-Tomcat-NG: microsoft.public.dotnet.xml
|
| Hello,
|
| Does anybody know how to edit the structure of XML files using VS.NET?
| I have an XML file and just need to add an additional column. The file
| already has a hundred of records. The only method I know is to go through
| all of them and add the appropriate tags manually (or using a trick with
| "Find and Replace"). This method is painful and I believe there must be
| another one.
| Should I use schema or something like that?
|
| Thanks for any hints,
| Leszek Taratuta
|
|
|
Leszek
11/13/2003 11:00:27 AM
Thank you very much.

Leszek

[quoted text, click to view]

AddThis Social Bookmark Button