Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
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 August 20th, 2003, 12:56 PM
Registered User
Join Date: Aug 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default catching an URL variable in xslt

Hello all,

I need some help catching an url-variable that I am passing from an html page to an xsl page. I'm getting bruised elsewhere, perhaps this is where the true guru's reside.......

- what I'm trying to do, is:
in one xslt page, I have it outputing HTML, with some links to another xslt page, that will also output html, both using the same xml input page.

The links are as so (example):
<a href="apTransDetail.cfm?item={../ColData[@colID='10']/@value}">845.92</a>
which comes out in the HTML as:
<a href="apTransDetail.cfm?item=2852-1059087424">845.92</a>

In other words, I am passing the ID number of a transaction, so I can click on the amount/href, and then go to a page displaying the detail of the transaction. - The cfm page in the href is the template that calls the xsl processor (msxml).

The transaction ID that I'm trying to pass is the key I need to filter my output on the 2nd page, to just show the detail for that item.

I suppose I could make a 2nd xml request/response for the detail from the DB, but wouldn't it be cleaner and faster to simply re-use my xml page for both pages, as it has the detail for both?

Orrrrr - is there another approach I am not considering in my XML/XSL newbie state?


Old August 21st, 2003, 01:32 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 147
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to armmarti

I think your approach is quite ok: I would choose the same approach. About reusing the XML doc: if the interface is designed so that the XML source document you supplied for transformation is referred only by filename, then it's impossible to reuse it. That is, if you perform the transformation by calling some function like this:
  outputDoc = transform(xmlFileName, xsltFileName)
and this is the only way to perform transformations in your cfml pages,
then you can't reuse XML documents for that purpose. Or, if you can use objects to perform transformations, like this, for example:

  sourceXMLObj = load(xmlFileName);
  xsltObj = load(xslFileName);
  outputDoc = transform(sourceXMLObj, xsltObj)
then probably you can get the XML source object once and put it in a session variable for later use. But in this case you must be sure that the XML source document is not very big to hurt the server memory(may be the server will keep the XML as a DOM tree, which is really expensive) since the server will keep one such object for every user-session.

If you are thinking also about how to pass the parameter to the stylesheet (through apTransDetail.cfm), then you must look at MSXML's documentation. Generally, every XSLT processor does it in a different form.


Similar Threads
Thread Thread Starter Forum Replies Last Post
assign XSLT variable to a wml variable arunagottimukkala XSLT 2 October 19th, 2007 05:15 AM
capture variable in URL Lemonluv07 BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 1 March 31st, 2006 04:00 AM
capture a variable from url. .com?jblp jblp PHP How-To 1 October 25th, 2004 07:26 PM
passing a variable through URL katie456 Classic ASP Databases 2 January 20th, 2004 11:27 PM
Resolving a URL using XSLT vibin_nair XSLT 1 October 21st, 2003 03:53 AM

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