Bryn,
At 05:56 PM 12/19/2006, you wrote:
ok, I now understand the problem, but not the solution. What I
actually want is this:
<span class="x">
<xsl:value-of select="count(key('key2_1', 'general'))" />
</span>
<xsl:for-each select="document(string($options))/options/option">
<span class="y">
<xsl:value-of select="count(key('key2_1', .))" />
</span>
</xsl:for-each>
to produce this:
<span class="x">4</span>
<span class="y">4</span>
and not:
<span class="x">4</span>
<span class="y">0</span>
That is, each of the options/option values is an index into the key.
I don't want to have to specify what each of them is.
It looks to me as though you want:
<span class="x">
<xsl:value-of select="count(key('key2_1', 'general'))" />
</span>
<xsl:variable name="option-keys"
select="document(string($options))/options/option">
<span class="y">
<xsl:value-of select="count(key('key2_1', $option-keys))" />
</span>
Or something of that sort.
It happens that keys can also take node sets as arguments to provide
multiple values at once. As you can see, this can be useful. (I use a
variable for clarity but you could just throw the document() query
straight into the call to key() if you wanted.)
Cheers,
Wendell
======================================================================
Wendell Piez
mailto:wapiez(_at_)mulberrytech(_dot_)com
Mulberry Technologies, Inc. http://www.mulberrytech.com
17 West Jefferson Street Direct Phone: 301/315-9635
Suite 207 Phone: 301/315-9631
Rockville, MD 20850 Fax: 301/315-8285
----------------------------------------------------------------------
Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--