]> xenbits.xensource.com Git - libvirt.git/commitdiff
docs: newapi: Fix generation of type definition tables
authorPeter Krempa <pkrempa@redhat.com>
Thu, 29 Feb 2024 12:50:09 +0000 (13:50 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 1 Mar 2024 11:51:56 +0000 (12:51 +0100)
Ensure that all rows have 3 columns and avoid generation of emtpy
elements which would be turned by the XML formatter into non-pair td/tr
tags which don't work properly with HTML5 parsers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
docs/newapi.xsl

index 51f159a2f8389e8b41f3e8b6d80b550ac20d31aa..aff4cf0d4e95632ddaaa41259ec1cb36f07a1e13 100644 (file)
           <xsl:for-each select="field">
             <xsl:choose>
               <xsl:when test='@type = "union"'>
-                <tr><td><span class="keyword">union</span> {</td></tr>
+                <tr><td colspan="3"><span class="keyword">union</span> {</td></tr>
                 <tr>
                   <td><table>
                     <xsl:for-each select="union/field">
                           </span>
                         </td>
                         <td><xsl:value-of select="@name"/></td>
-                        <xsl:if test="@info != ''">
-                          <td>
+                        <td>
+                          <xsl:if test="@info != ''">
                             <div class="comment">
                               <xsl:call-template name="dumptext">
                                 <xsl:with-param name="text" select="@info"/>
                               </xsl:call-template>
                             </div>
-                          </td>
-                        </xsl:if>
+                          </xsl:if>
+                          <xsl:comment> </xsl:comment>
+                        </td>
                       </tr>
                     </xsl:for-each>
                   </table></td>
-                <td></td></tr>
-                <tr><td>}</td>
-                <td><xsl:value-of select="@name"/></td>
-                <xsl:if test="@info != ''">
+                  <td colspan="2"><xsl:comment> </xsl:comment></td>
+                </tr>
+                <tr>
+                  <td>}</td>
+                  <td><xsl:value-of select="@name"/></td>
                   <td>
-                    <div class="comment">
-                      <xsl:call-template name="dumptext">
-                        <xsl:with-param name="text" select="@info"/>
-                      </xsl:call-template>
-                    </div>
+                    <xsl:if test="@info != ''">
+                      <div class="comment">
+                        <xsl:call-template name="dumptext">
+                          <xsl:with-param name="text" select="@info"/>
+                        </xsl:call-template>
+                      </div>
+                    </xsl:if>
+                    <xsl:comment> </xsl:comment>
                   </td>
-                </xsl:if>
-                <td></td></tr>
+                </tr>
               </xsl:when>
               <xsl:otherwise>
                 <tr>
                     </span>
                   </td>
                   <td><xsl:value-of select="@name"/></td>
-                  <xsl:if test="@info != ''">
-                    <td>
+                  <td>
+                    <xsl:if test="@info != ''">
                       <div class="comment">
                         <xsl:call-template name="dumptext">
                         <xsl:with-param name="text" select="@info"/>
                         </xsl:call-template>
                       </div>
-                    </td>
-                  </xsl:if>
+                    </xsl:if>
+                    <xsl:comment> </xsl:comment>
+                  </td>
                 </tr>
               </xsl:otherwise>
             </xsl:choose>