XPath: Target entries based on condition
This is an open discussion with 4 replies, filed under XSLT.
Search
<xsl:apply-templates select="projects/entry[image != ''][position() <= 3]" />
Hey phoque,
Thank you very very much! Works like a charm.
I didn’t realise you could do two predicates!
You bet!
Create an account or sign in to comment.
Hey,
I have a set of project entries. Each project may or may not contain an image, i.e. it is an optional section field.
I have this code
which is working fine.
Now I wonder if there’s a way to select the latest 3 entries only from within those records that contain an image node.
Is this possible with XPath?
Thanks for any help!