xsl-list
[Top] [All Lists]

Re: [xsl] Is XPath and/or XSLT designed such that I should never have to write special case code?

2021-06-22 23:27:39
On Tue, 2021-06-22 at 19:51 +0000, Dimitre Novatchev
dnovatchev(_at_)gmail(_dot_)com wrote:


Example: finding all (X)Html elements that have class $myClass:

      //*[contains(concat(' ', @class, ' '), concat(' ', $myClass, '
')]


Expressions like this, which work in some cases but are not partially
case insensitive in the way that HTML class attributes are defined to
be, is part of why we introduced contains-token() in XPath 3. 

However, you're right, it's a good example for matching a token in a
space-separated list.

Liam

-- 
Liam Quin, https://www.delightfulcomputing.com/
Available for XML/Document/Information Architecture/XSLT/
XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
Barefoot Web-slave, antique illustrations:  http://www.fromoldbooks.org
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

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