p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > XML > XSLT
I forgot my password Register Now
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 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.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 12th, 2005, 03:20 PM
Registered User
Points: 4, Level: 1
Points: 4, Level: 1 Points: 4, Level: 1 Points: 4, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old January 13th, 2005, 05:37 AM
mhkay's Avatar
Wrox Author
Points: 12,735, Level: 48
Points: 12,735, Level: 48 Points: 12,735, Level: 48 Points: 12,735, Level: 48
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 3,923
Thanks: 0
Thanked 82 Times in 80 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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

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 06:26 AM
Cross platform CD writing library hamidmq Linux 0 February 1st, 2005 03:19 AM
Cross-site Scripting bekim ASP.NET 1.1 3 September 7th, 2004 03:40 PM
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



All times are GMT -4. The time now is 03:54 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc