title: How to subtract value in xslt?
body: <p>Could you please tell me how to subtract value in xslt using a variable?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;xsl:variable name="currentCurpg" select="1"/&gt;
  &lt;xsl:variable name="tCurpg" select="($currentCurpg-1)"/&gt;
  </code></pre>
  
  <p>The variable <code>tCurpg</code> should be <code>zero</code> or <code>0</code>.</p>
  
  <p>Why I am getting error?</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"&gt;
      &lt;xsl:output method="html" doctype-public="XSLT-compat" omit-xml-declaration="yes" encoding="UTF-8" indent="yes" /&gt;
  
      &lt;xsl:template match="/"&gt;
        &lt;hmtl&gt;
          &lt;head&gt;
            &lt;title&gt;New Version!&lt;/title&gt;
          &lt;/head&gt;
           &lt;xsl:variable name="currentCurpg" select="1"/&gt;
            &lt;xsl:variable name="tCurpg" select="($currentCurpg-1)"/&gt;
       &lt;xsl:value-of select="$tCurpg"/&gt;
  
        &lt;/hmtl&gt;
      &lt;/xsl:template&gt;
  
  
  &lt;/xsl:transform&gt;
  </code></pre>
  
  <p>I am expecting output <code>zero</code>.</p>