Search

Can this be done?

Say my xml is something like this;

<group>
<node selected="yes">
*Other XML stuff*
</node>

<node>
*Other XML stuff*
</node>

<node>
*Other XML stuff*
</node>
</group>

How do I then do this:

<xsl:apply-templates select="group/node"> but make it exclude the one with selected="yes" as I don't want that one outputted to the front end?

Of course, using predicates:

<xsl:apply-templates select="node[not(@selected='yes')]" />

Brilliant! Worked perfectly. Thanks for the quick response too!

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