[xsl] Literals in XSLT

Subject: [xsl] Literals in XSLT
From: "Ruth Ablett" <utaku_rutsuko@xxxxxxxxxxx>
Date: Sun, 08 Feb 2004 00:52:52 -0700

I am attempting to write an XML-to-XML filter for document entries. The user can filter the XML file by author, title, or type (ps, pdf, doc, etc). Structure of xml:

<?xml version="1.0">
   <title>I Like Cheese</title>

To do it all in one XSL file, I wrote the following:

<xsl:param name="query">'Ruth Ablett'</xsl:param>
<xsl:param name="search-mode">=</xsl:param>
<xsl:param name="sort-by">author</xsl:param>
<xsl:param name="BigQuery" select="concat($sort-by, $search-mode, $query)"/>

... XSL required stuff...

 <xsl:if test="{$BigQuery}">
   <xsl:apply-templates select="so">

... the "so" template has the required stuff to filter the document. However, the transformer blows up at {$BigQuery}. Can I use literals {} like that?


Ruth Ablett

"Microsoft's No. 1 product is Windows, which now comes automatically installed on every computer in the world and many kitchen appliances. Technically, Windows is an "operating system," which means that it supplies your computer with the basic commands that it needs to suddenly, with no warning whatsoever, stop operating.

I speak from experience here. Many a time I have spent hours writing a serious and thoughtful column on an important issue, only to have Windows -- which is often referred to as "the French labor union of software" -- get into a snit and call a general computer strike that erases all my work moments before deadline, leaving me with no choice but to bang out a highly inaccurate column such as this one."

- Dave Barry

Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=dept/features&pgmarket=en-ca&RU=http%3a%2f%2fjoin.msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca

XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list

Current Thread