passing an xslt variable through a form handler url

I created a full text search form using the form handler as mentioned in the Tamino user guide:

I’m trying to pass along a variable to a stylesheet through this form.

My form looks something like this:

This will send the following URL: http://myserver/tamino/mydb/mycollection?_HTMLreq=_XQL//tamino/mydb/mycollection/xsl:stylesheet/searchResults.xslt&xslt_TOCBookTitle=How to Get Rich Quick&XQLNode=//TOC&//*=sometypedinkeyword

On my stylesheet I have:

<xsl:param name=“TOCBookTitle”>

<xsl:template match="/">
<xsl:value-of select="$TOCBookTitle/>
. . . .

This does not work. My form works fine when I remove the &xslt_TOCBookTitle=How to Get Rich Quick&XQLNode, so I know the from is OK. The styelsheet works fine too. I just can’t make this happen. Is there anyway to pass along a variable to a stylesheet through a form handler or XQL type URL?

Any help would be much appreciated!

Hi Julia,

This is a bit tricky!

The processing of a URL in Tamino works as follows:
(1) split URL into separate parameters delimited by “&”
(2) for each parameter:
(2.1) get command string:= part of parameter left of ‘=’
(2.2) get
command verb := part of command string left of ‘/’
style sheet ref := part of command string right of ‘/’
(2.3) if command verb is unknown: ignore; otherwise:
(2.4) execute command and embed stylesheet ref into XML response
<?xml-stylesheet type="text/xsl" href="style sheet ref "?>

Based on (1) it is not really surprising that your approach did not work.
If you use URL encoding for ‘&’ and ‘=’, i.e. “…%26xslt_TOCBookTitle%3D…”

  • the style sheet ref inserted into the response document will not be truncated due to (1) but contain “…&xslt_TOCBookTitle=…”
  • the stylesheet should be retrieved by the browser as desired
  • the bad news is:
    at least IE 7 does not seem to resolve the URL in the xml-stylesheet processing instruction once it contains an ampersand.
  • the little good news: it works with Firefox