File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "how to compare two int ?" Watch "how to compare two int ?" New topic

how to compare two int ?

Holger Prause
Ranch Hand

Joined: Oct 09, 2000
Posts: 47
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 ..
Ajith Kallambella

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

<xsl:if test="$pattern = $pattern2">
// whaterver
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


Chris McGuirk

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.
I agree. Here's the link:
subject: how to compare two int ?
It's not a secret anymore!