title: How do I add .01 to the end of a number using XSLT?
body: <p>I need to add .01 to the entry in this line of code in my XSLT script <code>&lt;xsl:apply-templates select=&quot;descendant::xhtml:span[@property = 'atom:content-item-name']&quot;/&gt;</code>. This number appears twice in my output. I only need the .01 on the second entry. How would I do that? I guess it would be in effect a counter because if there are 2 questions I'd need it to number as .02, etc.</p>
  <p>This is the full XSLT script:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;
      xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;
      xmlns:math=&quot;http://exslt.org/math&quot;
      xmlns:xd=&quot;http://www.oxygenxml.com/ns/doc/xsl&quot;
      xmlns:xhtml=&quot;http://www.w3.org/1999/xhtml&quot;
      xmlns:mml=&quot;http://www.w3.org/1998/Math/MathML&quot;
      xmlns=&quot;http://www.w3.org/1999/xhtml&quot;
      exclude-result-prefixes=&quot;xs math xd xhtml mml&quot;
      version=&quot;3.0&quot;&gt;
      
      &lt;xsl:output encoding=&quot;UTF-8&quot; include-content-type=&quot;no&quot; indent=&quot;no&quot; method=&quot;xhtml&quot; omit-xml-declaration=&quot;yes&quot;/&gt;
      
      
      &lt;!-- attributes, commments, processing instructions, text: copy as is --&gt;
      &lt;xsl:template match=&quot;@*|comment()|processing-instruction()|text()&quot;&gt;
          &lt;xsl:copy-of select=&quot;.&quot;/&gt;
      &lt;/xsl:template&gt;
      
      &lt;!-- elements: create a new element with the same name, but no namespace --&gt;
      &lt;xsl:template match=&quot;*&quot;&gt;
          &lt;xsl:param name=&quot;content-item-name&quot;/&gt;
          &lt;xsl:element name=&quot;{local-name()}&quot;&gt;
              &lt;xsl:apply-templates select=&quot;@*|node()&quot;&gt;
                  &lt;xsl:with-param name=&quot;content-item-name&quot; select=&quot;$content-item-name&quot;/&gt;
              &lt;/xsl:apply-templates&gt;
          &lt;/xsl:element&gt;
      &lt;/xsl:template&gt;
      
      &lt;!-- process root --&gt;
      &lt;xsl:template match=&quot;xhtml:html&quot;&gt;
          &lt;xsl:text disable-output-escaping=&quot;yes&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/xsl:text&gt;
          &lt;xsl:sequence select=&quot;'&amp;#x0a;'&quot;/&gt;
          &lt;html&gt;
              &lt;xsl:apply-templates select=&quot;@* | node()&quot;/&gt;
          &lt;/html&gt;
      &lt;/xsl:template&gt;
      
      &lt;!-- process item, pass content item name variable --&gt;
      &lt;xsl:template match=&quot;xhtml:li[@property='ktp:question']&quot;&gt;
          &lt;li&gt;
              &lt;xsl:apply-templates select=&quot;@*|node()&quot;&gt;
                  &lt;xsl:with-param name=&quot;content-item-name&quot; select=&quot;descendant::xhtml:span[@property='atom:content-item-name']/@data-value&quot;/&gt;
              &lt;/xsl:apply-templates&gt;
          &lt;/li&gt;
      &lt;/xsl:template&gt;
      
      &lt;!-- branching point for any interaction type-based updates --&gt;
      &lt;xsl:template match=&quot;xhtml:li[@property='ktp:question']&quot;&gt;
          &lt;li&gt;
              &lt;xsl:apply-templates select=&quot;@*|node()&quot;&gt;
                  &lt;xsl:with-param name=&quot;interactionType&quot; select=&quot;//xhtml:span[@property='ktp:interactionType']&quot;/&gt;
              &lt;/xsl:apply-templates&gt;
          &lt;/li&gt;
      &lt;/xsl:template&gt;
     
      &lt;!-- Change content --&gt;
      &lt;xsl:template match=&quot;xhtml:ol[@class='ktp-question-set']&quot;&gt;
      
          &lt;xsl:variable name=&quot;content-item-name&quot; select=&quot;xhtml:span[@property='atom:content-item-name']/@data-value&quot;/&gt;
          &lt;xsl:variable name=&quot;feedbackPara&quot;
              select=&quot;xhtml:section[@property = 'ktp:stimulus']&quot;/&gt;
              &lt;ol property=&quot;ktp:questionSet&quot; typeof=&quot;ktp:QuestionSet&quot; class=&quot;ktp-question-set&quot;&gt;
                  &lt;li class=&quot;ktp-question-set-meta&quot;&gt;
                      &lt;section property=&quot;ktp:metadata&quot; class=&quot;ktp-meta&quot;&gt;
                          &lt;xsl:apply-templates
                              select=&quot;descendant::xhtml:span[@property = 'atom:content-item-name']&quot;/&gt;
                      &lt;/section&gt;
                      &lt;section property=&quot;ktp:tags&quot; class=&quot;ktp-meta&quot;&gt;
                          &lt;span class=&quot;ktp-meta&quot; property=&quot;ktp:questionSetType&quot;&gt;shared-stimulus&lt;/span&gt;
                      &lt;/section&gt;
                  &lt;/li&gt;
                  &lt;li class=&quot;ktp-stimulus&quot; typeof=&quot;ktp:Stimulus&quot; property=&quot;ktp:stimulus&quot;&gt;  
                                             
                          &lt;xsl:apply-templates
                              select=&quot;descendant::xhtml:section[@property = 'ktp:stimulus']&quot;/&gt;
                      
                      &lt;p class=&quot;place-top atom-exclude&quot;&gt;Stimulus End: Place content above this line&lt;/p&gt;
                  &lt;/li&gt;
                  &lt;li class=&quot;ktp-question&quot; typeof=&quot;ktp:Question&quot; property=&quot;ktp:question&quot;&gt;
                      
                      &lt;section class=&quot;ktp-question-meta&quot;&gt;
                          &lt;section property=&quot;ktp:metadata&quot; class=&quot;ktp-meta&quot;&gt;   
                      &lt;xsl:apply-templates
                          select=&quot;descendant::xhtml:span[@property = 'atom:content-item-name']&quot;/&gt;
                          &lt;/section&gt;
                          &lt;xsl:apply-templates
                              select=&quot;descendant::xhtml:section[@property = 'ktp:tags']&quot;/&gt;
                      &lt;/section&gt;   
                                         
                          &lt;xsl:apply-templates
                              select=&quot;descendant::xhtml:section[@class = 'ktp-question-stem']&quot;/&gt;
           
                          &lt;xsl:apply-templates
                              select=&quot;descendant::xhtml:ol[@class = 'ktp-answer-set']&quot;/&gt;
              
                          &lt;xsl:apply-templates
                              select=&quot;descendant::xhtml:section[@property = 'ktp:explanation']&quot;/&gt;
             
                  &lt;/li&gt;                
              &lt;/ol&gt;   
      &lt;/xsl:template&gt;
      
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  <p>This is the input section where I need to pull the data-value from:</p>
  <pre><code>&lt;section class=&quot;ktp-question-meta&quot;&gt;
                 &lt;section property=&quot;ktp:metadata&quot; class=&quot;ktp-meta&quot;&gt;&lt;span property=&quot;atom:content-item-name&quot; class=&quot;ktp-meta&quot; data-value=&quot;lsac820402&quot;&gt;&lt;/span&gt;&lt;/section&gt;
                 &lt;section property=&quot;ktp:tags&quot; class=&quot;ktp-meta&quot;&gt;
                    &lt;span property=&quot;ktp:interactionType&quot; class=&quot;ktp-meta&quot;&gt;single-select&lt;/span&gt;
                    &lt;span property=&quot;ktp:questionType&quot; class=&quot;ktp-meta&quot;&gt;Assumption (Sufficient)&lt;/span&gt;
                    &lt;span property=&quot;ktp:difficulty&quot; class=&quot;ktp-meta&quot;&gt;★&lt;/span&gt;
                    
                 &lt;/section&gt;
  </code></pre>
  <p>This is how I need that section to appear with the .01 added to that data-value:</p>
  <pre><code>&lt;section class=&quot;ktp-question-meta&quot;&gt;
     &lt;section property=&quot;ktp:metadata&quot; class=&quot;ktp-meta&quot;&gt;
        &lt;span property=&quot;atom:content-item-name&quot; class=&quot;ktp-meta&quot; data-value=&quot;lsac820402.01&quot;&gt;&lt;/span&gt;
  &lt;/section&gt;
  </code></pre>