title: Validation error converting nested lists
body: <p>The XSLT code written below, which checks for sublists and converts to XSL-FO, is not working properly: </p>
  
  <pre><code>&lt;xsl:template match="ol|OL"&gt;
     &lt;fo:list-block provisional-distance-between-starts="1cm"
        provisional-label-separation="0.5cm"&gt;
        &lt;xsl:attribute name="space-after"&gt;
          &lt;xsl:choose&gt;
            &lt;xsl:when test="ancestor::ul or ancestor::ol"&gt;
              &lt;xsl:text&gt;0pt&lt;/xsl:text&gt;
            &lt;/xsl:when&gt;
            &lt;xsl:otherwise&gt;
              &lt;xsl:text&gt;12pt&lt;/xsl:text&gt;
            &lt;/xsl:otherwise&gt;
          &lt;/xsl:choose&gt;
        &lt;/xsl:attribute&gt;
        &lt;xsl:attribute name="start-indent"&gt;
          &lt;xsl:variable name="ancestors"&gt;
            &lt;xsl:choose&gt;
              &lt;xsl:when test="count(ancestor::ol) or count(ancestor::ul)"&gt;
                &lt;xsl:value-of select="1 + 
                                      (count(ancestor::ol) + 
                                       count(ancestor::ul)) * 
                                      1.25"/&gt;
              &lt;/xsl:when&gt;
              &lt;xsl:otherwise&gt;
                &lt;xsl:text&gt;1&lt;/xsl:text&gt;
              &lt;/xsl:otherwise&gt;
            &lt;/xsl:choose&gt;
          &lt;/xsl:variable&gt;
          &lt;xsl:value-of select="concat($ancestors, 'cm')"/&gt;
        &lt;/xsl:attribute&gt;
        &lt;xsl:apply-templates select="*"/&gt;
      &lt;/fo:list-block&gt;
    &lt;/xsl:template&gt;
  </code></pre>
  
  <p>We use FOP to create a PDF, but I am getting this exception</p>
  
  <blockquote>
    <p>9010004 : FOP_RENDER_ERROR; nested exception:
    org.apache.fop.fo.ValidationException: Error(Unknown location):
    fo:list-block is not a valid child element of fo:list-block.</p>
  </blockquote>
  
  <p>What's wrong with the XSLT?</p>