• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to compare two int ?

 
Holger Prause
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Holger Prause
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes it helped me,

p.s strange syntax i think ...

but thx, its workin now

Holger

 
Chris McGuirk
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic