[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
RE: how to: Conditionally call nested XSLs based on pa
Subject: RE: how to: Conditionally call nested XSLs based on parameters or variables passed to it at a higher level?
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Fri, 12 Sep 2003 17:04:05 -0400
|
Abhishek,
If I understand you rightly, I think you might, in addition to exploring
the options already described, consider whether, instead of passing
parameters through your templates (which can be quite cumbersome to
maintain, as you may be discovering), instead associate "parameter" values
(they won't be xsl parameters) with higher-level wrapper nodes (sections or
whatever) through some kind of "function" -- which would take the form,
either of an XPath expression you can use at need when in your lower-level
templates (such as <xsl:if test="ancestor::section/@type='chapter'">) or a
lookup table you can consult, or a named template you can call, or a
combination of these.
This is just because some problems that seem to call for passing templates
down through the tree, to provide "state" to templates at lower levels, can
sometimes be solved equally well by providing that state by other means
(such as XPath queries and/or dynamic local variable assignments, both of
which XSLT is very good at).
Am I making any sense?
Cheers,
Wendell
At 12:17 PM 9/12/2003, you wrote:
Michael.
Dimitre
Please have a look at this.
http://www.biglist.com/lists/xsl-list/archives/200309/msg00470.html
Here I have implemented with the help of a number of significant people,
a parameter passing model that goes into nested templates ( basically
templates that are called by others, i.e. where X calls Y but Y can
never call X. It's kind of Y nested inside X.
I am trying to do the same for the entire document stylesheets I have so
that I do not have to hard code the stuff.
Of course, Dimitre in effect I want to achieve the functional
programming paradigm while maintaining XSL 1.0 specs ( the ones current
supported by the System.Xml.Xsl transform ) ( I do know that Saxon
supports XSLT 2.0 with Functions but I cannot use those things.)
Also, the FXSL project. Are they a set of XSL based extension libraries
or will I actually need to install "extension" code with my XSLT
processor.
I would like to remain "pure" xsl 1.0 as much as possible. So, any
comments or ideas based on the (above URL) and improving that would be
great. Any other "pure XSL" ideas would be nice.
I have printed out that whitepaper of yours that talks about
" One particularly elegant way to deal with parameters scoping is by
using partial application -- described in the second reference above.
"
___&&__&_&___&_&__&&&__&_&__&__&&____&&_&___&__&_&&_____&__&__&&_____&_&&_
"Thus I make my own use of the telegraph, without consulting
the directors, like the sparrows, which I perceive use it
extensively for a perch." -- Thoreau
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format
RSS 2.0 |
|
Atom 0.3 |
|
|