Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 12th, 2005, 03:20 PM
Registered User
Join Date: Jan 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Cross-platform scripting

 What I need: An XSLT template I can run on the server OR the client (IE6 or FireFox) without any hassles.

Simple Question: Can I use a template with parameters written in XSL as a function in an XPATH query. (My suspicion is no, because I haven't been able to find a simple answer after days of searching)

If not: I know I can write an XPATH function in Javascript, but there appears to be different ways to do this in different XSLT parsers. This is incredibly frustrating because both browsers and my server-side parser support Javascript, they just embed it differently!!! Is there no cross-platform approach?

What I'm trying to do: I have a bunch of comma delimited values stored in a global parameter (ex. "Skills,Weaknesses,Names"). Each node of a certain type contains an attribute that contains a list of comma delimited values, some of which may or may not exist in the global parameter(ex. "Skills, Strengths, Languages"). I want to write an XPATH function that I can use in an XSL sort tag to sort a group of nodes based on the following criteria:

If parameters value is "Skills,Weaknesses,Names":

If the current node's attribute contains the first entry in the parameters value ("Skills"), it's position is 1.
If the current node's attribute contains the second entry in the parameters value ("Weaknesses"), it's position is 2.
If the current node's attribute contains the third entry in the parameters value ("Names"), it's position is 3.
and so on...

Please remember I need a cross-platform solution.

Thanks so much for your help.

Old January 13th, 2005, 05:37 AM
mhkay's Avatar
Wrox Author
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts

Take a look at sarissa.


Michael Kay
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cross platform Book xml example from Chapter 6 tomsc BOOK: Professional Ajax ISBN: 978-0-471-77778-6 0 June 25th, 2008 05:26 AM
Cross platform CD writing library hamidmq Linux 0 February 1st, 2005 03:19 AM
Cross Platform Help morpheus Classic ASP Basics 2 January 28th, 2004 11:02 AM
CROSS-PLATFORM javascript y_simonson XSLT 2 January 13th, 2004 05:16 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.