title: how to process number ranges in xslt2.0
body: <p>My XML.</p>
  
  <pre><code>&lt;a&gt;
   &lt;range nr="1" no-range="1 2 3 4" oc="4"/&gt;
   &lt;range nr="2" no-range="41 42 43 44" oc="4"/&gt;
   &lt;range nr="3" no-range="43 44 45 46" oc="4"/&gt;
   &lt;range nr="4" no-range="50 51 52 53" oc="4"/&gt;
   &lt;range nr="5" no-range="53 54" oc="2"/&gt;
   &lt;range nr="6" no-range="60 61" oc="2"/&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>I was trying this but not sure how to compare two arrays and print the difference:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0"&gt;
  &lt;xsl:template match="a"&gt;
      &lt;xsl:variable name="bRannge"&gt;
          &lt;xsl:for-each select="range"&gt;
              &lt;xsl:variable name="aRange" select="tokenize(concat(@no-range, ' '), ' ')"/&gt;
              &lt;xsl:value-of select="$aRange"/&gt;
          &lt;/xsl:for-each&gt;
      &lt;/xsl:variable&gt;
      &lt;xsl:variable name="cRange" select="tokenize(normalize-space($bRannge), ' ')"/&gt;
      &lt;xsl:variable name="aSeq"&gt;
          &lt;xsl:for-each select="1 to xs:integer(number($cRange[last()]))"&gt;
              &lt;xsl:value-of select="position()"/&gt;
              &lt;xsl:text&gt; &lt;/xsl:text&gt;
          &lt;/xsl:for-each&gt;
      &lt;/xsl:variable&gt;        
      &lt;xsl:variable name="bSeq" select="tokenize(normalize-space($aSeq), ' ')"/&gt;
      [&lt;xsl:value-of select="$cRange"/&gt;]
      [&lt;xsl:value-of select="$bSeq"/&gt;]
      &lt;!-- How to compare two arrays     --&gt;
  &lt;/xsl:template&gt;
  </code></pre>
  
  <p></p>
  
  <p>How can I get following report using xslt 2.0:</p>
  
  <ol>
  <li>Number ranges not in use 5-40, 47-49, 55-59</li>
  <li>'nr 3' is overlapping with 'nr 2' overlapping number = 43, 44</li>
  <li>'nr 5' is overlapping with 'nr 4' overlapping number = 53</li>
  </ol>