|
|
 |
| 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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

January 12th, 2005, 03:20 PM
|
|
Registered User
|
|
Join Date: Jan 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

January 13th, 2005, 05:37 AM
|
 |
Wrox Author
Points: 12,735, Level: 48 |
|
|
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 3,923
Thanks: 0
Thanked 82 Times in 80 Posts
|
|
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
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |