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
|