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
 
Old November 23rd, 2007, 12:11 PM
Registered User
 
Join Date: Nov 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Multi Valued Parameters in XSL

Hi,

I have a HTML search form sitting on a PHP page. I want to search a large xml document for values entered into the HTML form fields. I had planned to pass the form values to an XSL as parameters via PHP and then use XPATH within the XSL to search for node values within the XML document which match the form field values.

However, I can't get it to work with multi valued parameters. e.g. a multiple select box.

Is it possible to pass a multi valued parameter to XSL and if so how do you access the individual parameter values?

Is XSL a good approach to searching big XML documents?

Any help much appreciated,
Thanks




 
Old November 23rd, 2007, 02:04 PM
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

In XSLT 2.0 you could pass the parameters as a sequence of strings. That data type isn't available in 1.0, so you have a choice:

(a) create a little XML document in which the parameter strings are represented as elements, and pass this document as a parameter

(b) concatenate the parameter strings using a separator such as TAB, and then tokenize it within the stylesheet.

Probably (a) is easier and (b) is faster.

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
Passing parameters to XSL shahbhat XSLT 4 August 27th, 2008 11:08 AM
passing parameters from one xsl to another smys123 XSLT 4 June 21st, 2007 01:23 PM
Multi-Select Parameters jparkgb BOOK: Professional SQL Server 2005 Reporting Services ISBN: 0-7645-8497-9 0 August 14th, 2006 06:02 AM
Multi Parameters jcwc888 BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 1 March 16th, 2006 12:57 PM





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