Home Ajax Jquery Passing parameters to XSLT style sheets
Questions:Ask|Latest

 
 

Share on Google+Share on Google+

Passing parameters to XSLT style sheets

Advertisement
This page discusses - Passing parameters to XSLT style sheets

Passing parameters to XSLT style sheets

     

Passing parameters to XSLT style sheets

We can pass parameter for transformation using jQuery as :

 <script type="text/javascript">
$(function() {
// For display purposes only
$.ajax({
url: 'xslt-test.xml',
dataType: 'html',
success: function(data) {
$('#xmldata').text(data);
}
});

$.ajax({
url: 'xslt-test.xsl',
dataType: 'html',
success: function(data) {
$('#xsldata').text(data);
}
});

// The transformation
$('#output').xslt({xmlUrl: 'xslt-test.xml', xslUrl: 'xslt-test.xsl'});
});
</script>


The above code is used to set the xml/ xsl in the display window using jQuery.

After setting display, The xml and xsl is passed as parameters to the function '.xslt( )' for transformation under the variable  'xmlUrl' and 'xslUrl' respectively. This will transform the output into text string and display output in the div element 'output'.

Learn from experts! Attend jQuery Training classes.

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: April 18, 2011

Related Tutorials

Ask Questions?    Discuss: Passing parameters to XSLT style sheets  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
Sundance
September 23, 2011
UxujKAKUslGs

Just do me a favor and keep wrtinig such trenchant analyses, OK?
DMCA.com