> Or contains(concat(',', field, ','), 'DIR') but then you are sensitive
> to values like
> "DIR , OTHER"
> (a leading or trailing space should be removed by the XML parser,
> though)
Not a problem if spaces can occur only within the delimiters - just use:
contains(concat(',', translate(field, ' ', ''), ','), ',DIR,')
On Thu, Jan 2, 2025 at 5:16b/PM Liam R. E. Quin liam@xxxxxxxxxxxxxxxx <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> On Thu, 2025-01-02 at 23:04 +0000, Martin Honnen martin.honnen@xxxxxx
> wrote:
> >
> > contains-token tokenizes on pure whitespace, no? With that comma in
> > there I don't think it helps.
>
> oh, i didn't look closely enough, you're right. No, tokenize() it is.
>
> Or contains(concat(',', field, ','), 'DIR') but then you are sensitive
> to values like
> "DIR , OTHER"
> (a leading or trailing space should be removed by the XML parser,
> though)
>
> 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
|