xsl-list
[Top] [All Lists]

[xsl] String sequence as key match

2010-03-22 09:11:31
Hey list,

I used to use a key declaration like this
<xsl:key name="element-by-class" match="h:*" use="@class"/>
to match XHTML elements like <p class="Quote"> by supplying a classname:
key('element-by-class', 'Quote')

But now I have changed my XHTML input so that the class attribute can
actually include multiple classnames, for example:
<p class="Quote Text_body">

I managed to fix my template matches by using h:p[(_at_)class/tokenize(., '
') = 'Quote'] instead of simply h:p[(_at_)class = 'Quote'].

But what about that key declaration, can I change it in the same way
to take into account every classname from the @class attribute? Maybe
using contains() or tokenize() somehow? So that
key('element-by-class', 'Quote') would still match an element if one
of its classnames is 'Quote'.

Thanks,

Martynas
odt2epub.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>
--~--

<Prev in Thread] Current Thread [Next in Thread>