|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: dynamic code in the xsl page
> Here is a question: I need to have in my result html page values that > are dynamic, yet not retrieved from my xml data. > (for example action method in a form tag - that posts to different > server depending on the configuration or sorting column that is > determined by the user dynamically via the request rather than hard > coding the sort column in the xsl page) > How do I obtain that ? > Having my xsl page completely static is a big problem. XSLT is a functional language; the output is a pure function of the input. To have the same input (source, stylesheet, and top-level parameters) produce different output each time is a violation of this principle. Nevertheless, it is possible to use extension functions to obtain data from external sources at run-time. The risk is that the XSLT processor may cache the function results, so if you need to call something more than once with the same arguments, you can't rely on the same side-effects being produced (e.g., if you pass the same value to an extension function twice, expecting it to return, for example, a unique ID for each call, you might get the same return value both times). http://www.w3.org/TR/xslt#section-Extension-Functions briefly describes extension functions, but you will have to consult the documentation for your XSLT processor to find out what namespaces it uses and what the extension functions actually do. A typical Java XSLT processor allows extension functions to call a method from any class that is in the classpath, for example. You might also be interested in using top-level parameters, described at http://www.w3.org/TR/xslt#top-level-variables and also implementation dependent. > Are there going to be implementation specific portability issues ? Yes, extension functions and the mechanism by which top-level parameters are passed in are definitely implementation specific. XSLT only defines a way to call extension functions if they are available, and a way to bring in a top-level parameter, if it has been supplied. Also, there is a mailing list specifically for XSL questions. http://www.mulberrytech.com/xsl/xsl-list/ - Mike ____________________________________________________________________ Mike J. Brown, software engineer at My XML/XSL resources: webb.net in Denver, Colorado, USA http://www.skew.org/xml/
|
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
|
|||||||||

Cart








