Groups | Blog | Home
all groups > dotnet xml > july 2003 >

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



KathyBurke40 NO[at]SPAM attbi.com
7/13/2003 12:28:49 PM
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.

Oleg Tkachenko
7/14/2003 12:08:31 AM
[quoted text, click to view]

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
Kirk Allen Evans
7/14/2003 11:20:47 AM
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


[quoted text, click to view]

AddThis Social Bookmark Button