Search

Once I'd realised that ends-with() was only a function in XSLT 2, I found this Q/A indicating how to emulate it in XSLT 1.

I'm trying to display my github feed, but not display any entries that have a title ending with '(deleted)'; I thought this looked right (for the included elements in my Dynamic XML):

//atom:entry[not(substring(atom:title, string-length(atom:title)-10) = '(deleted)')]

…but it isn't. What am I missing?

Ta,
D

Have you tried looking at what

substring(//atom:entry/atom:title, string-length(//atom:entry/atom:title)-10)

actually returns?

Hey Nils – I embarrassed to confess that I hadn't done anything that rational.

Now I have, I see that my problem's solved by changing '-10' to '-8'.

Thanks.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details