[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: dynamic code in the xsl page

  • From: Mike Brown <mbrown@c...>
  • To: 'asenator' <asenator@t...>
  • Date: Thu, 02 Nov 2000 11:51:42 -0700

how to bring dynamic xslt
> 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!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.