Click here to Skip to main content
15,892,298 members
Articles / Programming Languages / C#
Article

How to manage the xml files

Rate me:
Please Sign up or sign in to vote.
1.11/5 (15 votes)
6 Aug 2006 21.6K   116   15   3
You can use this class to manage the xml files
  • C#
    <A href="XmlControl/XmlControl_src.zip"></A><A href="XmlControl/XmlControl_src.zip"></A><A href="http://www.codeproject.com/useritems/XmlControl/20060805.zip">Download source files - 9.66 Kb</A> 

Introduction

I found use the .net framework to manage the xml is very dificult. but the .net framework is had a lot of functions. This XmlControl's function is less, but I think that's enough to manage the xml files in commonly.

If you want to use this control to manage an exit xml file, you can use folow example to use.

C#
<BR>XmlControl fileCon=new XmlControl("filePath");

If you want to create an new xml file, you can use this

C#
XmlControl fileCon=new XmlControl();

You must set the XmlControl's RootNode like this

C#
fileCon.RootNode.Name="example";

You can't to save the file that you can't set the RootNode's name.

You can use the XmlControl.Elements.Add() method to add an xml node, like this

C#
<BR>XmlElement elem=new XmlElement(); <BR>elem.Name="example"; <BR>elem.Value="example"; <BR>fileCon.Elements.Add(example);

If you can't understand, you can use the Email to connect me. Because my english is poor so ......  ^_^

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
China China
Deverloper

Comments and Discussions

 
Generalvote of 1 Pin
freakyit1-Sep-09 10:06
freakyit1-Sep-09 10:06 
GeneralThanks Pin
NormDroid6-Aug-06 23:22
professionalNormDroid6-Aug-06 23:22 
GeneralRe: Thanks Pin
Robert Rohde7-Aug-06 3:29
Robert Rohde7-Aug-06 3:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.