473,395 Members | 1,468 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,395 software developers and data experts.

Kirk Allen Evans---? how do I use your code to update my xmlDocument?

Kirk,

The other day you very kindly explained how the client/server thing
works. May I ask just one more question? Could you give me an example
of what code I would put in the client html to post back the user
input to the server xmlDocument?

You gave me:

One way is to use the Request.Form collection to read the values
directly
out of the post.

System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
doc.Load(Server.MapPath("data/xmlfile1.xml"));
if(!IsPostBack)
{
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
doc.Load(Server.MapPath("data/xmlfile1.xml"));
System.Xml.Xsl.XslTransform trans = new
System.Xml.Xsl.XslTransform();
trans.Load(Server.MapPath("xslt/xsltfile1.xslt"));
//transform the results directly to the output stream
trans.Transform(doc,null,Response.OutputStream,new
System.Xml.XmlUrlResolver());
}
else
{
System.Xml.XmlNode node = doc.SelectSingleNode("Customer/@ID");
node.Value = Request.Form["txtCustomerID"];
doc.Save(Server.MapPath("data/newxmlfile1.xml"));
}
This has helped me understand a lot...Thanks again, Kirk.

Kathy
Nov 11 '05 #1
1 1932
The example you quoted shows how to interrogate the Forms collection for a
specific <input> HTML element. That should do the trick.

You can also use the client side DOM to post the XML back. There is an
example in the SDK.

http://msdn.microsoft.com/library/en...asp?frame=true

--
Kirk Allen Evans
www.xmlandasp.net
Read my web log at http://weblogs.asp.net/kaevans
"KathyB" <Ka**********@attbi.com> wrote in message
news:75**************************@posting.google.c om...
Kirk,

The other day you very kindly explained how the client/server thing
works. May I ask just one more question? Could you give me an example
of what code I would put in the client html to post back the user
input to the server xmlDocument?

You gave me:

One way is to use the Request.Form collection to read the values
directly
out of the post.

System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
doc.Load(Server.MapPath("data/xmlfile1.xml"));
if(!IsPostBack)
{
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
doc.Load(Server.MapPath("data/xmlfile1.xml"));
System.Xml.Xsl.XslTransform trans = new
System.Xml.Xsl.XslTransform();
trans.Load(Server.MapPath("xslt/xsltfile1.xslt"));
//transform the results directly to the output stream
trans.Transform(doc,null,Response.OutputStream,new
System.Xml.XmlUrlResolver());
}
else
{
System.Xml.XmlNode node = doc.SelectSingleNode("Customer/@ID");
node.Value = Request.Form["txtCustomerID"];
doc.Save(Server.MapPath("data/newxmlfile1.xml"));
}
This has helped me understand a lot...Thanks again, Kirk.

Kathy

Nov 11 '05 #2

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

Similar topics

1
by: Sean | last post by:
hi, I have been trying to solve this problem since morning, and haven't really come up with a solution. it is frustrating. please help. i have a datagrid and got a delete column ...
5
by: KathyB | last post by:
If someone could just explain this to me...I just don't get it! I have an aspx page where I retrieve several session variables and use xmlDocument to transform xml file with xsl file into an...
2
by: KathyB | last post by:
Hi, I have a transformed xml source into html for client input. In order to update the xmlDoc on the server, how do I specify the correct nodes if they are built dynamically through assigning id's...
1
by: George W. | last post by:
Okay, I'm a C#/XML newbie, and I've been wrestling with this for a while now, checked dotnet sites, articles, MSDN Library, etc. and haven't been able to determine why this is happening. I have...
8
by: pete | last post by:
Hi there, Can someone explain to me why I can't bind to an XmlDocument but I can bind to an XmlNodeList. It's my understanding that they both implement the IEnumerable interface which is...
2
by: Simon Hart | last post by:
Anyone have any links handy? Regards Simon.
4
by: Farraige | last post by:
Hi I need your help... I am implementing the method that updates given table (table is represented as list of lists of strings) according to other table (some kind of merging)... This method...
12
by: praveenkrg | last post by:
my update query is not working properly! $mgroupname=$_GET; //echo $mgroupname; ///query for checking userg_id $result=mysql_query("SELECT * FROM group WHERE userg_name ='$mgroupname'");...
9
by: Vbbeginner07 | last post by:
Private Sub cmdEdit_Click() mName = Trim(ListView1.SelectedItem) mesge = MsgBox("Are you Sure you Want to Update " & mName & "?", vbOKCancel, "ERROR") '=MsgBox "You have selected the employee" &...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
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...

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.