Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XSLT: conditional with "or"

 
Veronica Damian
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

can you do conditionals with "or" in XSLT? (equiv. of "||" in a java conditional...)

I don't think <xsl:choose> would accomplish same goal, as I don't want to have to repeat content in XSLT..

I want to say IF a certain param in custom-tag equals this or that or that other THEN put this content here..

thank you very much..
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you can. And if you were trying to ask how, well, the XSLT "or" operator is "or".
 
Roseanne Zhang
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe Veronica Damian is asking how to match 2 different elements by using the same template.

I think the or operator is "|".

The same code for identity template:
 
Veronica Damian
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you very much.. that's what I thought (since for 'and' it's 'and'..;)
but it's being ignored..
ok, thanks again..

Originally posted by Paul Clapham:
Yes, you can. And if you were trying to ask how, well, the XSLT "or" operator is "or".
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Veronica Damian:
but it's being ignored..
That would be because you are expecting it to do something different than what you really told it to do. If you are still having a problem and would like help with it, don't hesitate to post the details here.
[ November 26, 2007: Message edited by: Paul Clapham ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic