Avatar of cutie_smily
cutie_smily

asked on 

xslt if with 2 conditions

XSLT IF CONDITION

<xsl:if test="pfi-upload:CODE!='LivingLife'">
                         && pfupload:CARE='Charlotte'">

i have error on the above . I was wondering how to write xsl:if condition with test conditions in it
Web Languages and Standards

Avatar of undefined
Last Comment
abel
ASKER CERTIFIED SOLUTION
Avatar of zc2
zc2
Flag of United States of America image

Blurred text
THIS SOLUTION IS 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
Avatar of abel
abel
Flag of Netherlands image

My guess is that pfi-upload and pfupload are the same namespace prefixes and that you have a typo there. So, if "an error" persists after zc2's solution, check the correct namespace prefixes.

Note also that often you should not be using xsl:if or xsl:choose. Instead using something like the following, where the processor will (correctly) decide upon what template to choose and you do not have to build the programming logic anymore.
<xsl:template match="pfi-upload:CODE[. != 'LivingLife']">
 
<!-- or... because you are probably matching some parent -->
<xsl:template match="someparent
         [pfi-upload:CODE[. != 'LivingLife']]
         [pfupload:CARE[. = 'Charlotte']]">

Open in new window

Web Languages and Standards
Web Languages and Standards

Web development can range from developing the simplest static single page of plain text to the most complex web-based internet applications, electronic businesses, and social network services using a wide variety of languages and standards, including the familiar HTML, JavaScript and jQuery, ASP and ASP.NET, PHP, ColdFusion, CSS, PHP, Flex and Flash, but also the implementation of a broad list of standards including XML, WSDL, SSDL, VoiceXML and many more.

40K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo