Forum Moderators: open
I am working on my first XML/XSLT project and I am confused about one thing (so far ;): How do I pass a variable from one transform to another? This is a real basic question but I can't find a clear explanation of how to do it or why it isn't possible.
I have an XML file with full details for club venues. I want a list of names and logos, and to build a "more information" link that will load a detail page that will access different nodes of the same XML file, so I would like to pass the venue ID in the URL. Is there no way to pick a variable out of a URL?
Please have patience with me. If this question is stupid and there is a super beginner's tute somewhere you can point me to, that would be appreciated too.
Thanks!
Or, if you are happy to have both the index and the more information on the same page, this is quite easy to build in XSL using two separate templates within the same XSL file. The first one parses the XML and builds the index with internal jump hyperlinks, and the second parses it again to build the detail parts with anchor points.
<a href="#id">more information</a>
...
...
...
<h3 id="id">Full details about venue</h3>
...
...
...
Or is this an XSLT/XPath technique? My file is too complicated to display everything on one page load. Can you elaborate?
Thank you!
My second suggestion was, as you understood, to create an index at the top of a page, with links down to the details using a template that creates a list of <a href="#12>Club venue</a> tags, and a second template which creates a list of <a name="12"><h1>Title</h1></a> type records. If that won't work for you because of the size of the dataset, then I'm afraid I'm stumped.
Any other XSLT gurus know the answer?