[xsl] Re: Re: Re: Dynamic Filter Menus

Subject: [xsl] Re: Re: Re: Dynamic Filter Menus
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Fri, 26 Oct 2001 22:30:14 -0700 (PDT)
> I figured it out, so here is what I had to use. I couldnt use DOM like was
> suggested because it didnt like "xsl:script" for some reason and when I
> tried to use it directly with entries like:

Unfortunately, You didn't get the idea. I suggested that you modify your stylesheet
after it has been loaded and compiled (after you have obtained a DOMDocument object
containing the stylesheet), but ***before*** the transformation is started.

Therefore this excludes any usage of "xsl:script" (BTW there's no such element in
XSLT 1.0).

> Outside my templates I used:
>
> <xsl:variable name="vven" select="/docs/vendorfilter" />
> <xsl:variable name="vcat" select="/docs/categoryfilter" />
> <xsl:variable name="vver" select="/docs/versionfilter" />
> 
> <xsl:key name="venkey"       match="entry" use="@vendor" />
> <xsl:key name="catkey"       match="entry" use="@category" />
> <xsl:key name="verkey"       match="entry" use="@version" />
> <xsl:key name="vencatkey"    match="entry[@category=$vcat]" use="@vendor" />
                    

The above xsl:key definition is illegal -- references to variables are not allowed
in the match pattern of xsl:key. This is to avoid circular definitions, as global
variables may be defined using the key() function.

In case your XSLT processor did not flag this as error, it is better to use a truly
compliant XSLT processor instead.

Even if this worked, it suffers from a "combinatorial explosion" problem and should
not be preferred to other, more compact and maintainable solutions.

Cheers,
Dimitre Novatchev.

__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

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


Current Thread