OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: dynamic code in the xsl page

[ Lists Home | Date Index | Thread Index ]
  • From: Mike Brown <mbrown@corp.webb.net>
  • To: 'asenator' <asenator@tgix.com>
  • Date: Thu, 02 Nov 2000 11:51:42 -0700

> 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/




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS