XSL - how to set variable as integer if it comes from string
<blockquote>
  <p>XPTY0004  :   The operator    '   +   '    is not defined for operands of type
    xs:string    and    xs:integer</p>
</blockquote>

<p>IMPUT:</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;LeveL Plan="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;


&lt;space2000&gt;
&lt;values&gt;
&lt;value jak="77" rak="12"&lt;/value&gt;
&lt;value jak="66" rak="345"&gt;&lt;/value&gt;
&lt;value jak="-50" rak="67"&gt;&lt;/value&gt;
&lt;value jak="-30" rak="-89"&gt;1&lt;/value&gt;
&lt;/values&gt; 

&lt;/space2000&gt;


&lt;/LeveL&gt;
</code></pre>

<p>MY TRY:</p>

<pre><code>&lt;xsl:stylesheet version="2.0" 
xmlns:fn ="http://www.w3.org/2005/xpath-functions"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
&lt;xsl:template match="/"&gt;
&lt;xsl:for-each select="(LeveL/space2000/values)"&gt;
&lt;xsl:variable name="JJJ"  select="(format-number(((value/@jak) div 2),'0'))"/&gt;
&lt;xsl:variable name="RRR"  select="format-number(((value/@rak) div 2),'0')"/&gt;
&lt;xsl:text&gt;
O
&lt;/xsl:text&gt;
&lt;xsl:text&gt;LA&lt;/xsl:text&gt;
&lt;xsl:value-of select="$JJJ"&gt;&lt;/xsl:value-of&gt;
&lt;xsl:text&gt; &lt;/xsl:text&gt;&lt;xsl:text&gt;LO&lt;/xsl:text&gt;
&lt;xsl:value-of select="$RRR"&gt;&lt;/xsl:value-of&gt;
&lt;xsl:text&gt;
O
&lt;/xsl:text&gt;

&lt;xsl:choose&gt;
     &lt;xsl:when test="( $JJJ &gt; '0')"&gt;
        &lt;xsl:value-of select="A"/&gt;
     &lt;/xsl:when&gt;
     &lt;xsl:when test="( $JJJ &lt; '0')"&gt;
        &lt;xsl:value-of select="B"/&gt;
     &lt;/xsl:when&gt;
       &lt;xsl:when test="( $RRR &gt; '0')"&gt;
        &lt;xsl:value-of select="C"/&gt;
     &lt;/xsl:when&gt;
     &lt;xsl:when test="( $RRR &lt; '0')"&gt;
        &lt;xsl:value-of select="D"/&gt;
     &lt;/xsl:when&gt;   
     &lt;xsl:when test="( ( $RRR + '50') &lt; '0' )"&gt;
        &lt;xsl:value-of select="X"/&gt;
     &lt;/xsl:when&gt;
     &lt;xsl:when test="( '-100' &lt; ( $RRR + '1') &lt; '100' )"&gt;
        &lt;xsl:value-of select="X"/&gt;
     &lt;/xsl:when&gt;


&lt;/xsl:choose&gt;

&lt;/xsl:for-each&gt;

&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;
</code></pre>

<p>so I would like ro recive something like:
A
C
B
D
X</p>

<p>but xsl </p>

<p>dont't like + ( is not trusting its integer :)</p>

<p>don"t like &lt; ( the other way > is for him acceptable :)</p>

<blockquote>
  <p>SO MY QUESTION IS   </p>
  
  <p>a) How to set variable (or element) as integer able to do mathematics? </p>
  
  <p>b) How to test if variable is bigger than -100 and smaller than 100 ?</p>
</blockquote>

<p>PLEASE HEEEEEELP :)</p>