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 May 19th, 2004, 05:18 PM
Registered User
 
Join Date: May 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default dynamic XSLT from HTML variable

I am hoping to select a different node form my xml file for each link on a html page. This node from the xml file is then run through an xslt page to output a html page. I have included some pseudo code below. Is it even possible to send a parameter to an xslt page so that I can select a specific node? I believe I am missing something fundamental about xslt but I'm not sure what. Thank you in advance for your help.

1st HTML:
<a href="animals.xml select name=alex">Alex the Dog</a>
<a href="animals.xml select name=bart">Bart the Cat</a>
<a href="animals.xml select name=clark">Clark the Rabbit</a>

XSLT:
<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
     <xsl:value-of select="animal/name/" /> is a good <xsl:value-of select="animal/type/" />

</xsl:template>
</xsl:stylesheet>


XML:
<animal>
     <name>Alex</name>
     <type>dog</type>
</animal>
<animal>
     <name>Bart</name>
     <type>cat</type>
</animal>
<animal>
     <name>Clark</name>
     <type>rabbit</type>
</animal>

Output HTML if bart link is clicked on:
Bart is a good cat







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
dynamic session variable in while loop ashuphp Beginning PHP 0 May 3rd, 2007 04:59 AM
dynamic variable/object names TheBFJ Excel VBA 2 November 13th, 2006 07:11 AM
dynamic xslt -> xslt creation namespace problem jkmyoung XSLT 2 July 15th, 2006 12:42 AM
Defining a Dynamic Range using a variable Alseikhan Excel VBA 0 March 27th, 2006 02:26 AM





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