[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Newbie ? - dynamic linking two xslt templates
Hi Jeremy,
please see my comments, Cheers, Abel Braaksma http://abelleba.metacarpus.com Jeremy Patterson wrote: 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). This sounds like a server-side approach to me. Which is good, because you can do more and you'll have less trouble dealing with browser peculiarities.
This means you actually use a client-side approach. It is possible, but I would advice against it. And even if you do, I'd advice to make it a little more sophisticated: select the XML file through Javascript's XMLHttpRequest object (this is AJAX technology, there're books written about it and mailing lists also) and parse it client side using and XSLT engine from the client. After that, you can server it however you like. And you have the option to choose your stylesheet, your XML and your parameters. But this is not an *easy* solution. In fact, it requires quite some knowledge of a multitude of technologies.
There are so many options to fill this one in. Do you need to do it all on the client side, or can you parse/transform on the server side? That would end up being so much easier.
Good! But remember, you are doing client side xslt, this is only XSLT 1.0. Browsers as of yet are not capable of anything more than that and won't be for some time to come. Conclusion: you'll have to choose some technique, client side transformation or server side transformation. In the latter case, you can use Saxon's XSLT 2.0 capabilities (if you stick to saxon on the server side, but there are more engines to choose from). In the former case, be prepared to spend some time learning the various techniques involved. You may even choose to do it with a little bit of server effort and the rest the way you do it now: client side. One (of many) approach can be, making the following statement in the XSLT file dynamic using SSI, or a server language like PHP, Perl etc. <?xml-stylesheet type="text/xsl" href="{{{fillthisindynamically}}}"?>
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|