Avatar of Kreuz Nacher
Kreuz Nacher
 asked on

XSL for-each loop - Excluding specific text

Looking for the proper syntax in xsl:for-each loop to exclude a row based on specific text in a title attribute.

Original code:  
<xsl:for-each select="$Rows">

Open in new window


My failed attempt to include full title value (ideally I'd like to replace "!= to "not contains" logic:
<xsl:for-each select="$Rows [@title != 'Consent Form Requirements']">

Open in new window

XML

Avatar of undefined
Last Comment
Gertone (Geert Bormans)

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Gertone (Geert Bormans)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Gertone (Geert Bormans)

as a bonus advice...

[@title != 'Consent Form Requirements']

you should never do that
it can fail because of various reasons
in XSLT1 the = operator is a set compare
whenever you think you are using != in a string compare
not(=) is what you really want (in 99% of the cases)

[not(@title = 'Consent Form Requirements')]
is what you should do
Kreuz Nacher

ASKER
Thank you again!  I had to make one small adjustment, but that's on my side.  I asked this based on an attribute and it turns out it wasn't an attribute, so I just took out the @ and it worked fine.  

Love your answers, really helping me dust off the cob webs on this stuff!
Gertone (Geert Bormans)

welcome
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy