Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 6th, 2006, 04:22 AM
Authorized User
 
Join Date: Jul 2006
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
Default xslt with parameters


I was wondering if is possible that one xslt file makes different transformations depending on some input parameters.

For instance, my xslt file makes different transformations depending on a <xsl:if> condition.
If I want to make 5 different kinds of transformations I need 5 different xslt files which only differ in only line of code(the if condition).

Any ideas?


Tomi.







 
Old September 6th, 2006, 05:40 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Yes, you can declare parameters using <xsl:param> as a child of the <xsl:stylesheet> element. The way you supply parameter values at run time depends on the API of your chosen XSLT processor.

It's not possible to supply parameters if you invoke the transformation using the <?xml-stylesheet?> processing instruction.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
Can XSLT read DTD/schema and Generate XSLT.. ROCXY XSLT 1 November 6th, 2006 09:39 AM
Getting post/get parameters with XSLT? snorripall XSLT 2 October 6th, 2006 11:39 AM
dynamic xslt -> xslt creation namespace problem jkmyoung XSLT 2 July 15th, 2006 12:42 AM
Passing parameters from ASP (VBScript) to XSLT rj_mayer Classic ASP XML 5 January 25th, 2005 04:20 PM
Passing parameters to an XSLT kiril XSLT 1 May 15th, 2004 10:29 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.