[xsl] Newbie ? - dynamic linking two xslt templates
Subject: [xsl] Newbie ? - dynamic linking two xslt templates
From: Jeremy Patterson <patterj@xxxxxxxxxxxx>
Date: Wed, 20 Sep 2006 12:58:08 -0400
|
I'm creating a webpage for a high school that lists the student's
homework assignments. I used xslt/xml solution because it had to be a
somewhat dynamic solution, would not tax the server, and be easily
managed. The department head wants the site to be more in depth, where a
student would select the teacher's name on a webpage and the student
would be taken to a teacher page listing the assignments for that
particular teacher.
I believe xslt/xml solution is still the best way to do this. I have
come up with two xslt templates, one listing all the teachers(teacher
directory), and another that generates the teacher's webpage based on a
variable that is passed into xslt template. The teacher directory
webpage will trigger the teacher xslt and pass a teacher's name, thus
creating the teacher webpage. They are both generated from the same xml
document, that will be updated by a web form (it's not their yet).
The problem I have is generating the dynamic link that will trigger the
teacher xslt template. I have very limited experience with xml/xslt, I
have always embedded the xslt page in the xml document like this:
<?xml-stylesheet type="text/xsl" href="xslTemplate.xsl"?>
I don't think this is going to work because I'm using two different xslt
templates. I also have no idea on how I would write the link to the
teacher template, I would imagine the link would be the same, but I
would just be passing a different value to the parameter in the teacher
xslt. I have always just linked to the xml page which would trigger the
xslt, but I don't think I can do that because I have two xslt templates
working off the xml document.
This has to be a simple solution. I'm using Jenni Tennison's "Beginning
XSLT 2.0" for reference. It has helped immensely in suggesting I compile
through saxon, so I can view output. I'm hung up on creating the dynamic
links that will link the two xslt templates together.
Jeremy