473,473 Members | 1,730 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to edit a single node in a xml file

2 New Member
Hi
I have a xml file as follows
<?xml version="1.0" encoding="utf-8"?>
<MeasuresList>
<Measures>
<Parameters>Target Achievement</Parameters>
<Weightage>50%</Weightage>
</Measures>
<Measures>
<Parameters>Contribution% (as per PCPI)</Parameters>
<Weightage>20%</Weightage>
</Measures>
<Measures>
<Parameters>DSO Multipliers</Parameters>
<Weightage>10%</Weightage>
</Measures>
<Measures>
<Parameters>ecdi parameter</Parameters>
<Weightage>60%</Weightage>
</Measures>
<Measures>
<Parameters>sathish</Parameters>
<Weightage>22</Weightage>
</Measures>
<Measures>
<Parameters>shyam</Parameters>
<Weightage>60</Weightage>
</Measures>
</MeasuresList>



i have bounded this sml file in a datagrid and have placed a radio button in each row.. when i click the radio button of the third row in the datagrid
this
<Measures>
<Parameters>DSO Multipliers</Parameters>
<Weightage>10%</Weightage>
</Measures>
particular values must be delted pls give me c# code for this immiditely
Mar 10 '08 #1
1 1137
dip_developer
648 Recognized Expert Contributor
Hi
I have a xml file as follows
<?xml version="1.0" encoding="utf-8"?>
<MeasuresList>
<Measures>
<Parameters>Target Achievement</Parameters>
<Weightage>50%</Weightage>
</Measures>
<Measures>
<Parameters>Contribution% (as per PCPI)</Parameters>
<Weightage>20%</Weightage>
</Measures>
<Measures>
<Parameters>DSO Multipliers</Parameters>
<Weightage>10%</Weightage>
</Measures>
<Measures>
<Parameters>ecdi parameter</Parameters>
<Weightage>60%</Weightage>
</Measures>
<Measures>
<Parameters>sathish</Parameters>
<Weightage>22</Weightage>
</Measures>
<Measures>
<Parameters>shyam</Parameters>
<Weightage>60</Weightage>
</Measures>
</MeasuresList>



i have bounded this sml file in a datagrid and have placed a radio button in each row.. when i click the radio button of the third row in the datagrid
this
<Measures>
<Parameters>DSO Multipliers</Parameters>
<Weightage>10%</Weightage>
</Measures>
particular values must be delted pls give me c# code for this immiditely
Expand|Select|Wrap|Line Numbers
  1.  
  2.     Xml.XmlDocument MyXMLDocument = new Xml.XmlDocument(); 
  3.     Xml.XmlNode myMainNode; 
  4.  
  5.  
  6.  
  7.     //write code here to Load the XML document 
  8.  
  9.  
  10.     Xml.XmlNode myNode = myMainNode.SelectSingleNode("item1"); 
  11.     if (myNode != null) { 
  12.         myNode.InnerText = "some other value"; 
  13.     } 
  14.  
Mar 10 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Roger | last post by:
I need to edit the IIS 6.0 config file (metabase.xml) and had a go with this code, trying to get a list of all defined websites, and write their name to console, but it does not seem to work, would...
7
by: ritchie | last post by:
Hi, I am writing for some help with editing a linked list. I would be gratful if anybody has the time to take a look at this. I am trying to edit a node by entering a date as a key. If an...
4
by: Henk | last post by:
Hi, I am new to the c-programming language and at the moment I am struggling with the following: I want to read a file using fread() and then put it in to memory. I want to use a (singel)...
1
by: yzhao | last post by:
I would like to put a treenode into edit mode right after its parent is expanded, i.e., a user clicks the plus sign of a parent node, after the expansion, put the first node into edit mode. I...
4
by: Glenn M | last post by:
I have a shared XML file on a server . i also have one xslt file that performs a simple transform on in to view the data. now i want to have another page that lets users modify the shared xml...
0
by: ZAK | last post by:
I have written a small program to edit VBProject files to all file get written to same location and other things. I need help . I can't find a way of selecting the OutputPath, I just get either...
8
by: David Thielen | last post by:
Hi; I need to be able to create a single xml node in utf-8 and do it efficiently as this is called a lot (reason below). What is the best way to do this? I need to end up with a string like...
1
by: MrNobody | last post by:
I have a TreeView and I would like to have it function so that when someone right-clicks on a Node and chooses an option Edit under a context menu the node changes from a read only label to a...
0
by: Atos | last post by:
SINGLE-LINKED LIST Let's start with the simplest kind of linked list : the single-linked list which only has one link per node. That node except from the data it contains, which might be...
4
by: gator | last post by:
Hello, I am trying to edit a specific node in an XML file using C#. I have searched around for example code to do this. The only solutions I have come across either add a new node to the doc...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.