aspose file tools*
The moose likes XML and Related Technologies and the fly likes XSLT: conditional with Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XSLT: conditional with "or"" Watch "XSLT: conditional with "or"" New topic
Author

XSLT: conditional with "or"

Veronica Damian
Ranch Hand

Joined: Feb 04, 2006
Posts: 61
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
Bartender

Joined: Oct 14, 2005
Posts: 18989
    
    8

Yes, you can. And if you were trying to ask how, well, the XSLT "or" operator is "or".
Roseanne Zhang
Ranch Hand

Joined: Nov 14, 2000
Posts: 1953
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

Joined: Feb 04, 2006
Posts: 61
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
Bartender

Joined: Oct 14, 2005
Posts: 18989
    
    8

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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XSLT: conditional with "or"