Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| 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 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
  #1 (permalink)  
Old March 16th, 2006, 10:37 AM
Registered User
 
Join Date: Mar 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default URL variables in XSL

Hi,

I want to use an XSL stylesheet to represent the data in an XML file I have. Though I have to make selections very much. So i thougth that I could send information in the URL (like www.foo.se/boe.xml?id=1) where I can get the information from id and use it to select in my xml.

Is this possible and if so how do I implement that in my code. I'm very new to the use of XML and XSL..

Giel.
  #2 (permalink)  
Old March 16th, 2006, 10:57 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

You need some kind of application to invoke the transformation. In this application, extract the query parameters from the URL and pass them as stylesheet parameters (global <xsl:param> values) to the stylesheet. The API for doing this depends on the XSLT processor you are choosing to use: look for a method such as addParameter() or setParameter(). You may find a packaged application to do the job, for example Saxon supplies sample servlet code SaxonServlet.java which takes a URL with parameters in the form described.

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extrac URL from in the XSL file MM_lost XSLT 4 January 13th, 2006 05:54 AM
Url Variables cbevey XSLT 5 December 21st, 2005 10:33 AM
Sending URL with variables cckiat General .NET 4 December 7th, 2004 06:08 AM
Reassigning values to variables in XSL. rmiller XSLT 1 September 25th, 2004 02:43 AM
CH:2 Passing Variables throught a URL. GraphicArmy BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 5 April 28th, 2004 02:36 AM





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