views:

44

answers:

2

Hi,

I am new to XML and have been trying some simple examples and they work fine.

I want to do something like the following, but I am not able to figure out how to go about doing this.

I have a HTML web page, where the user types in some data in an input field. I want to take that data, parse it to create an XML string, and the apply XSLT transformation to it, and display the result back on the page. All this needs to be done on the client browser, with JavaScript. If some one could point out the steps or the general procedure to go about doing this, it would be great. I have been looking over the net, but the information is so vast, that I have not been able to locate exactly what I need.

Thanks

A: 

This tutorial my be helpful: http://www.w3schools.com/xsl/xsl_client.asp

David
+1  A: 

Look at jQuery XSLT plugin, it does exactly what you describing. There is a demo.

Eugene Kuleshov
Hi Eugene, I am trying the plugin you suggested, but I end up running into an error. I am using the string option and specifying the xml and the xsl as strings $('#output').xslt({xml: 'xml string', xsl: 'xsl string'});as suggested in the doc for the plugin. The browser reports that $('output') has not method named xslt. I really appreciate you helping me out with this. Thanks
Gunner4Life
Have you loaded plugin? E.g.<script type="text/javascript" src="../jquery.xslt.js"></script>also check if it is compatible with your jQuery version, it seem like it been built for jQuery 1.1.3.For the latest jQuery version 1.3 you may want to use Transform plugin http://plugins.jquery.com/project/Transform
Eugene Kuleshov
Yep, that was it. The loading was not quite proper. Its working great now. Thanks!
Gunner4Life