This gives me the correct items, but not in alphabetical order:
<xsl:param name="param1"/>
<xsl:param name="param2"/>
<xsl:template match="catalog/entry">
<xsl:if test="category[(_at_)type=$param1] and
category[(_at_)subcat=$param2]">
<xsl:for-each select="word">
<xsl:sort/>
<xsl:apply-templates/><br/>
</xsl:for-each>
</xsl:if>
</xsl:template>
Each entry only contains one word, so there's not much point sorting the
words within an entry.
This one gives me an alphabetized list, but of all the items,
not just the ones that match the params:
<xsl:template match="catalog">
<xsl:if test="entry/category[(_at_)type=$param1] and
entry/category[(_at_)subcat=$param2]">
<xsl:for-each select="entry/word">
<xsl:sort/>
<xsl:apply-templates/><br/>
</xsl:for-each>
</xsl:if>
</xsl:template>
That's because you're first testing if a qualifying entry exists, and if it
does, you're processing all the entries whether they qualify or not.
You want:
<xsl:template match="catalog">
<xsl:for-each select="entry[category[(_at_)type=$param1 and
@subcat=$param2]]/word">
<xsl:sort/>
<xsl:apply-templates/><br/>
</xsl:for-each>
</xsl:template>
Michael Kay
http://www.saxonica.com/
--~------------------------------------------------------------------
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>
--~--