By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,070 Members | 1,237 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,070 IT Pros & Developers. It's quick & easy.

request.form collection - how to dynamically update nodes from xsl/html source?

P: n/a
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 via the xsl
transformation?

Example:

within the xml/html I could have two input boxes whose names are not
assigned until tranformation, e.g., step_2.1_measure,
step_3.2_measure. How to capture the inner.text of these two items in
the server-side code?

I know understand I would generally use something like this for the
request.form action:

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"));
}

HOW to get the named nodes into the code above???

Hope this is clear enough...thanks in advance...this is my last big
piece of the puzzle I need to finish something.

Kathy
Nov 11 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
KathyB wrote:
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 via the xsl
transformation?

Example:

within the xml/html I could have two input boxes whose names are not
assigned until tranformation, e.g., step_2.1_measure,
step_3.2_measure. How to capture the inner.text of these two items in
the server-side code?


I'm not sure I fully understand what do you mean, but you can pass these
values as parameters to XSL Transformation using XsltArgumentList
collection.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #2

P: n/a
Not sure I understand either... Are you asking how to retrieve the elements
by ID from the Form collection? Or are you having problem accessing
elements when you are not sure what the ID of the element is?

--
Kirk Allen Evans
www.xmlandasp.net
Read my web log at http://weblogs.asp.net/kaevans
"Oleg Tkachenko" <ol***@multiconn.com> wrote in message
news:eH**************@TK2MSFTNGP10.phx.gbl...
KathyB wrote:
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 via the xsl
transformation?

Example:

within the xml/html I could have two input boxes whose names are not
assigned until tranformation, e.g., step_2.1_measure,
step_3.2_measure. How to capture the inner.text of these two items in
the server-side code?


I'm not sure I fully understand what do you mean, but you can pass these
values as parameters to XSL Transformation using XsltArgumentList
collection.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.