Re: Newbie, HTML calling XSLT
- From: Martin Honnen <mahotrash@xxxxxxxx>
- Date: Sat, 20 Aug 2005 14:16:25 +0200
Clive wrote:
For an exercise, I would like to write a simple HTML page that calls XSLT and passes it parameters.
I know how to "accept" parameters into xslt and I have tested this using Oxygen XML editor. It is the HTML to XSLT connection I don't understand.
Can this "link" be achieved with pure (X)HTML or do I need some programming language like Perl or php to achieve this?
HTML is a markup language which allows to markup a document that is then usually rendered in a user agent.
HTML is not a programming language while XSLT is one.
In some user agents, lets call them desktop browsers, you can have script embedded in a HTML document executed in the browser and even fewer of those browsers also allow script to access an XSLT processor and run an XSLT transformation and then also allow to pass parameters to the XSLT processor before a transformation is performed.
So using client-side JavaScript in Mozilla 1.2, Firefox, and in IE 6/Win (or IE 5 and 5.5 Win if an XSLT processor like MSXML 3 or 4 is installed) you can indeed do client-side XSLT transformation, not with HTML alone of course, but with script embedded in a HTML document.
Client-side is one approach although as you can see with the restrictions on a few browsers not a reliable one. Server-side XSLT is another approach but that of course requires that the HTML document contains a form or at least a link to a server-side script where the XSLT transformation is performed. Parameters are then passed from the HTML document in the browser to the server as usual, in the query string of the URL requested or in the body of the HTTP request, the server side script reads out those parameters as usual and can then perform an XSLT transformation and send the result back to the browser.
So for server-side transformation you usually use a server-side programming language like PHP respectively a server-side framework like ASP or JSP to perform an XSLT transformation but for some servers there are XSLT filters or modules that allow the use of XSLT without needing to go down to a programming language.
--
Martin Honnen http://JavaScript.FAQTs.com/ .
- References:
- Newbie, HTML calling XSLT
- From: Clive
- Newbie, HTML calling XSLT
- Prev by Date: Re: A DTD problem: "Content model is not determinist"
- Next by Date: Re: A DTD problem: "Content model is not determinist"
- Previous by thread: Newbie, HTML calling XSLT
- Next by thread: Re: Newbie, HTML calling XSLT
- Index(es):
Relevant Pages
|
Loading