]> granicus.if.org Git - docbook-dsssl/commitdiff
Leave optional groups around even single elements so that the optional doesn't get...
authorNorman Walsh <ndw@nwalsh.com>
Thu, 27 Sep 2007 13:36:45 +0000 (13:36 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Thu, 27 Sep 2007 13:36:45 +0000 (13:36 +0000)
docbook/relaxng/tools/doc2dtd.xsl

index c7188a6943c7b65cef6c60538f48581eebf97171..c2cb0f368bf8ff27cdb9191ae73116915f712b37 100644 (file)
 
 <xsl:template match="rng:optional" mode="trim">
   <!-- optional with multiple children needs a group? -->
+  <!-- ndw: 27 Sep 2007; even if optional has only a single child, it -->
+  <!--      needs a group because if you strip off the group, the optional -->
+  <!--      part sometimes gets lost (refsect2 inside refsect1, for example) -->
   <xsl:copy>
     <xsl:copy-of select="@*"/>
 
     <xsl:choose>
-      <xsl:when test="count(*) &gt; 1">
+      <xsl:when test="count(*) &gt;= 1">
        <rng:group>
          <xsl:apply-templates mode="trim"/>
        </rng:group>