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

Re: A few questions to the experts: functions, templat

Subject: Re: A few questions to the experts: functions, templates, loops
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Thu, 5 Sep 2002 00:54:28 -0700 (PDT)
 Re: A few questions to the experts: functions
> I am having some trouble with XML/XSLT, and it would be very nice if
> someone could help me with a few questions:
> 
> I have created a homepage-generation/management-xslt script using the
> data from a xml-database, of course, and saxon. I managed to get
> everything running up until now, but there are some things that I
> would
> really like to improve in my script:
> 1.) How do I write my own functions with return values? For example,
> I
> have a function that traverses the tree, searches a page by id and
> delivers the corresponding path-name. My solution up until now has
> been
> to create a template (please, don't laugh at me - I know this is most
> probably the worst possible approach) which delivers the name as
> text.
> This works, but... it's sort of.. akward

The way to implement a function in XSLT is to instantiate a template
within the body of an xsl:variable, then if necessary (whenever the
result is an RTF) convert the resulting RTF to a regular node-set,
osing the vendor:node-set() extension function.

More on implementation of functions in XSLT 1.0 and especially on
higher-order functions and treating functions as first class objects
can be found at the home page of FXSL -- the functional programming
library for XSLT 1,0:

http://fxsl.sourceforge.net/

It contains links to four articles, explaining the main ideas standing
in the base of FXSL, and also to the downloadable files of FXSL.





=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

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