473,405 Members | 2,141 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

saving XML file usinf XMLDoc

I have this small snippet below and i want to save some data back to the xml
file.
So i looked for a node and checked if the node value is the same as a
textbox value
and if yes i pass in the new value entered from a textbox back t the xml
datasource.
I'm populating values of the textboxes from an xml dtrasource
But it doesn't see to work am i missing something
Thanks in advance

string g = bbW;

if (node["Weighting"].InnerText == Weighting.Text)

{

node["Weighting"].InnerText = g;

}

-------------------------------------------------
code below

public void saveXmlData(string bbW)

{

XmlDocument xmlDocument = new XmlDocument();

xmlDocument.Load(Server.MapPath("WT.xml"));

XmlNodeList nodeList = xmlDocument.SelectNodes("//WeightingsRep");
foreach (XmlNode node in nodeList)

{

//Response.Write("todd:" + bbW);


string g = bbW;

if (node["Weighting"].InnerText == Weighting.Text)

{

node["BBWeighting"].InnerText = g;

}
}

xmlDocument.Save(Server.MapPath("WT.xml"));

xmlDocument = null;

}
Nov 27 '06 #1
1 1784
Forgot my XML doc looks like this :-
<?xml version="1.0" encoding="utf-8"?>
<Figures>
<Rep>
<Weighting>0.0708</Weighting>
</Rep>
</Figures>

Thanks
"Patrick.O.Ige" <na********@hotmail.comwrote in message
news:OE**************@TK2MSFTNGP04.phx.gbl...
I have this small snippet below and i want to save some data back to the
xml
file.
So i looked for a node and checked if the node value is the same as a
textbox value
and if yes i pass in the new value entered from a textbox back t the xml
datasource.
I'm populating values of the textboxes from an xml dtrasource
But it doesn't see to work am i missing something
Thanks in advance

string g = bbW;

if (node["Weighting"].InnerText == Weighting.Text)

{

node["Weighting"].InnerText = g;

}

-------------------------------------------------
code below

public void saveXmlData(string bbW)

{

XmlDocument xmlDocument = new XmlDocument();

xmlDocument.Load(Server.MapPath("WT.xml"));

XmlNodeList nodeList = xmlDocument.SelectNodes("//WeightingsRep");
foreach (XmlNode node in nodeList)

{

//Response.Write("todd:" + bbW);


string g = bbW;

if (node["Weighting"].InnerText == Weighting.Text)

{

node["BBWeighting"].InnerText = g;

}
}

xmlDocument.Save(Server.MapPath("WT.xml"));

xmlDocument = null;

}


Nov 27 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

90
by: charlesmusco | last post by:
Hi all. I have the following problem. I have an xml file, while I will list below and I am trying to add nodes to the xml document based on user input to a form. The XML doc is ... <?xml...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.