Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old January 12th, 2005, 02:20 PM
Registered User
 
Join Date: Jan 2005
Location: , , .
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.

Reply With Quote
  #2 (permalink)  
Old January 13th, 2005, 04:37 AM
mhkay's Avatar
Wrox Author
Points: 17,773, Level: 58
Points: 17,773, Level: 58 Points: 17,773, Level: 58 Points: 17,773, Level: 58
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,839
Thanks: 0
Thanked 267 Times in 262 Posts
Default

Take a look at sarissa.

http://sarissa.sourceforge.net/doc/

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 02:19 AM
Cross Platform Help morpheus Classic ASP Basics 2 January 28th, 2004 10:02 AM
CROSS-PLATFORM javascript y_simonson XSLT 2 January 13th, 2004 04:16 PM



All times are GMT -4. The time now is 02:13 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.