*
The moose likes XML and Related Technologies and the fly likes how to compare two int ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "how to compare two int ?" Watch "how to compare two int ?" New topic
Author

how to compare two int ?

Holger Prause
Ranch Hand

Joined: Oct 09, 2000
Posts: 47
Hello,
i cant help myself but i think XSLT is quite difficult , isnt it?
I am just searching for a possebility to compare to int
<xsl:variable name="pattern">1</xsl:variable>
<xsl:variable name="pattern2">2</xsl:variable>

<xsl:if $pattern="$pattern2">isnt doing what i want , boolean and xsl:when also not
it cant be too difficult i think, i just want to compare to values ..
Thx,
Holger
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
Try this and see if it works

<xsl:if test="$pattern = $pattern2">
// whaterver
</xsl:if>
Hope that helps
------------------

Ajith Kallambella M.
Sun Certified Programmer for the Java2 Platform.


Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
Holger Prause
Ranch Hand

Joined: Oct 09, 2000
Posts: 47
yes it helped me,

p.s strange syntax i think ...

but thx, its workin now

Holger

Chris McGuirk
Greenhorn

Joined: Jan 16, 2001
Posts: 7
The syntax isn't strange, <xsl:if $pattern=$pattern2> is not a well formed XML element, but <xsl:if test="$pattern=$pattern2"> is . XSL is built on XML.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to compare two int ?
 
Similar Threads
XSLT double quotes problem
Problem with Regex
XSLT - String conversion
xsl count
Changing the param of an applet with XSL or JS ...