|
You need to add an onclick to the button, which calls a javascript function that you'll also need to insert into your XSLT.
You mentioned you're using ASP.NET. You're not really, if you are, then this is all a real waste of time, unless you have a specific reason to want to avoid posting back in this instance.
By the way, it's possible to respond on the same thread, and it's also possible to edit and delete your posts.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Sorry, I'm not well to write english, may be it make a mistake about the communication
I'll try again
I mentioned using asp.net , that right, I use asp.net to make a user interface and send data form page to be a condition send to xslt file to retrieve data from xml file
and I add textbox to receive score form user and add textarea to receive comment from user
and the last when user click button I want to show summary of score
You suggest me to add javascript to xslt, I never use javascript and I think my computer not support , can I use vbscript?
Could you tell me an example or website that can solve my problem, please
Thank you so much
|
|
|
|
|
mathuros_paiboon wrote:
Sorry, I'm not well to write english
That's fine, I don't hold that against you. Hell, I ONLY speak English, so you're ahead of me in the long run.
mathuros_paiboon wrote:
I mentioned using asp.net , that right, I use asp.net to make a user interface and send data form page to be a condition send to xslt file to retrieve data from xml file
and I add textbox to receive score form user and add textarea to receive comment from user
and the last when user click button I want to show summary of score
Yes, my point is that so long as you're using ASP.NET, you should abandon the XSLT idea and instead do everything in ASP.NET, where it will be a lot easier.
mathuros_paiboon wrote:
You suggest me to add javascript to xslt, I never use javascript and I think my computer not support , can I use vbscript?
ASP.NET is a complex library that exists solely to generate web pages. From the browsers point of view, it recieves a text file and has no real idea where it comes from. All web browsers support javascript, in fact ASP.NET works much of it's magic by custom generated javascript that goes into every ASP.NET page. I believe you can use VBScript if all you want to support is IE, but every other browser will reject it. They are not that different, except that javascript looks like Java, and VBScript looks like VB.
mathuros_paiboon wrote:
Could you tell me an example or website that can solve my problem, please
There are plenty of javascript tutorial sites, they are only a google away, but I say again - you're doing things the hard way. If you just generate your page using ASP.NET, there's a ton of info on this site and heaps of people who will be able to help you with what will then become a very easy task. Otherwise, I'm sure there are plenty of javascript sites out there as well, but I don't know of any ( I avoid javascript where-ever possible because jscript is supported by all browsers, but not always in the same way ).
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
<xsl:stylesheet version="1.0"
="" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:asp="http://schemas.microsoft.com/intellisense/ie5" xmlns:state="http://www.vbxml.com/state" xmlns:str="http://www.vbxml.com/string" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<xsl:param name="calories">1500
<xsl:template match="/">
<xsl:for-each select="//form_name[@name=$calories]//*">
<xsl:if test="name() = 'activity'">
activiry | score | comment | <xsl:value-of select="@sub_group"> | <xsl:apply-templates> | | </td>
</xsl:if>
</tr>
</xsl:for-each>
</table>
<button id = "btn_score">summary score</button>
</xsl:template>
<xsl:template match="activity">
<xsl:value-of select="activity"/>
</xsl:template>
</xsl:stylesheet>
My problem
I add textbox (id = "score") and textarea (id = "comment") I want to get data form all textbox to calculate (make summary score) and to calculate percent
How I write command, can someone help me, please |
|
|
|
|
|
This is my xslt file
<xsl:stylesheet version="1.0"
="" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:asp="http://schemas.microsoft.com/intellisense/ie5" xmlns:state="http://www.vbxml.com/state" xmlns:str="http://www.vbxml.com/string" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<xsl:param name="calories">1500
<xsl:template match="/">
<xsl:for-each select="//form_name[@name=$calories]//*">
<xsl:if test="name() = 'activity'">
activity | score | comment | <xsl:value-of select="@sub_group"> | <xsl:apply-templates> | | </td> </xsl:if>
</tr>
</xsl:for-each>
</table>
<button id = "sum_score">summary score</button>
</xsl:template>
<xsl:template match="activity">
<xsl:value-of select="activity"/>
</xsl:template>
</xsl:stylesheet>
QUESTION
I add textbox (id = "score) for user and add button (id = "sum_score") I want to get data in all textbox to calculate the summary of score and calculate percent
can someone have a suggestion for me, please |
|
|
|
|
|
Did you check Do not treat <'s as HTML tags ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thank you for your suggestion, and I post the question again and check "do not treat"
please review my xslt file
Thank you
|
|
|
|
|
I have problem about xslt command
I retreive data form xml with xslt and add textbox/checkbox/textarea for receive data form user, and I want to use this data to calculate and save in another xml file , how I write the xslt command
I use asp.net with vbscript
Thank for help
|
|
|
|
|
XSLT accepts parameters, and passing them in via VB.NET is very easy. Here's an example from my code:
XsltArgumentList xsltArgs = new XsltArgumentList();
xsltArgs.AddParam("id", "", this.ClientID);
xsltArgs.AddParam("seldata", "", this.SelectedNodeData);
xsltTree.Transform(xData, xsltArgs, output, null);
If you look up the AddParam command in MSDN, you'll see the XSLT examples you need.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I have an application which ran fine under windows 2000. It is browser based and uses XMLTransform. The Authentication requirment is that the user must be either integrated or Digest (anonyomous is not allowed).
When I try to run the browser pages I get an error from xmltransform indicating that the rights are not correct. The probelm is even though I enter my user name and password to be authenticated, the program reports that I am accessing as :Authentication anonymous. A request.ServerVariables("AUTH_USER") reports blank (anonymous).
I have everything configured the same as on the windows 2000 machine as far as IIS only allowing integrated access yet I is not happening and the application control pages all .asp do not come up. Anonymous access is not allowed anywhere on the server yet this is continual.
Any Ideas?
Jan Michael
|
|
|
|
|
hi,
These contents i want to insert after farm elements where farm is equal to dev2
here is syntax of node element which i want to insert
<database state="0" name="one" sourceType="amacs">
<database>
I want Xml(database) to be inserted after farm where farm is equal to "dev2"
I am giving you the structure of XML file
<?xml version="1.0" encoding="UTF-8"?>
<root>
<farm-config>
<farm name="dev1">
<connection address="localhost" user="root" selectedConnection="1" password="ram">
<lastJob>Copy-All</lastJob>
<lastConnection startdate="2005-05-10" starttime="12:43:23" enddate="2005-05-10" endtime="12:58:32" />
<state>1</state>
</connection>
<database state="0" name="bd_plc1_house1_14022005" sourceType="amacs">
<tables state="0" name="feed_delivery">
</table>
</database>
</farm>
<farm name="dev2">
<connection address="localhost" user="root" selectedConnection="1" password="ram">
<lastJob>Copy-All</lastJob>
<lastConnection startdate="2005-05-10" starttime="12:43:23" enddate="2005-05-10" endtime="12:58:32" />
<state>1</state>
</connection>
</farm>
</farm-config>
</root>
i have the code pls anybody can modify it
This code is giving an syntax error
xmldoc.DocumentElement["farm name='dev2'"].PrependChild(databaseElement);
regards
sanjeev
|
|
|
|
|
Most likely cause of an error is that
ksanju1000 wrote:
xmldoc.DocumentElement["farm name='dev2'"].
is returning null. Given that you don't tell us the error ( despite asking this several times), I have to guess.
Assuming that farm name='dev2' is an XPath, you need //farm in order to find the node, unless you're at the level directly above it. Also, I believe that @ is required to show that you're matching a property in the node, but I am both rusty on XML, and quite sick at the moment, so I could be having a bad hair moment there.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian's 99% of the way there (if you *are* using XPath...)
The syntax you want is:
xmldoc.DocumentElement["//farm[@name='dev2']"].PrependChild(databaseElement);
HTH!
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
Hi
This path gives syntax error(Object reference not found)
can you again try
xmldoc.DocumentElement["//farm[@name='dev2']"].PrependChild(databaseElement);
This does not work
|
|
|
|
|
Hello all,
I'm trying to take an XMLnode (found with .SelectSingleNode()) from one document and copy it into another document. I keep gettting an error message that they are not the correct type. Anyone have some examples of the .clone function in VB.net 2005??
Thanks, Jeff
|
|
|
|
|
jeffb_ wrote:
VB.net 2005
I don't know how in 2k5, let be alone in VB... In good ol' .NET1.1 XML elements art in "document context" so elements can be used only within XmlDocument which created them.
(Just checked, work same way in .NET 2.0)
Well XmlNode ( so XmlElement too ) implements ICloneable . Should not be a problem.
David
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
Hi
I am trying to generate a XSD schema from a xml file by using a stream writer.
I created a dataset and read XML into that dataset.
Now I am trying the ds.WriteXmlSchema();
Actually it works correctly...but my issue is I want to send the written schema into a textbox on button click.
How would I do that?
This is the code I wrote for writing the schema:
System.IO.StreamWriter swXML= new System.IO.StreamWriter();
ds.WriteXmlSchema(swXML);
textBox1.Text =swXML.ToString();
|
|
|
|
|
|
Hi
I am using msxmlcpp library that was written by Sven Weigand. With this library
I parse an xml file. When one of my methods ends I receive an Access violation message
box. With debugging I have seen that it happens as a result of CXMLDOMNode class's destructor.
As a result of the destructor an ATL's CComPtr->Release method is called and it causes this
problem. Does anybody know how to solve thid problem?
Best regards
|
|
|
|
|
|
Hi
my program updates only farm name I want to search through loop farm name and it should
update address,
user and password from the existing file name
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load("c:/farm-config.xml");
XmlNode farm=xmldoc.SelectSingleNode("/root/farm-config/farm/@name");
MessageBox.Show(farm.InnerText);
farm.InnerText="devxcv1";
MessageBox.Show(farm.InnerXml);
xmldoc.Save("c:/farm-config.xml");
My XMl strucutrue is as given below
<?xml version="1.0" encoding="UTF-8"?>
<root>
<farm-config>
<farm name="sanjay">
<connection address="127.0.0.1" user="dog" password="cat">
<lastjob>Copy-All</lastjob>
<lastconnection startdate="2005-05-10" starttime="12:43:23" enddate="2005-05-10" endtime="12:58:32" />
<state>1</state>
</connection>
</farm>
<farm name="ram">
<connection address="localhost" user="root" selectedConnection="1" password="daask">
<lastJob>Copy-All</lastJob>
<lastConnection startdate="2005-05-10" starttime="12:43:23" enddate="2005-05-10" endtime="12:58:32" />
<state>1</state>
</connection>
</farm>
</farm-config>
</root>
--- supoose i want to find thr loop ram and i want o change address,user and password attribues value thr loop
if i change it changes the upper ones farm name=sanjay 's address,user and password
regards
sanjeev
|
|
|
|
|
Could you re-formulate this? In sentences maybe? Sorry, but I have hard time to understand what you have and what you want...
Maybe example of expected result could help. (?)
David
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
Hi buddy,
I have already implemented. Actually it searches the particular node from xml file and update child's node atrribute
Thanks for your interest
regards
sanjeev
|
|
|
|
|
Hello all!
I'm using ASP.NET and XML and sql server database.
I get daily updates in xml format and import them into the MSSQL DB.
I do this via a function in ASP.net using XmlReader.
The problem is that i have to do it manually!
Each morning i goto the asp.net website and click "get xml updates".
Is there any way to automate this procedure?
thanks guys
|
|
|
|
|
You Can use windows service for this.You can shedule your specific task like sending xml file to server by using ur service .You can start with it.
regards
sagar
|
|
|
|