XSLT & XSL-FO: Eine Tabelle mit mehreren Zeilen erstellen?

Ich bin ziemlich neu in XSLT und habe ein Problem, bei dem ich ein Element mit einer unbekannten Anzahl von Kindern habe. Ich muss diese Kinder in einer Tabelle anzeigen, sodass 5-6 Spalten verfügbar sind, um die Informationen anzuzeigen.

Wenn ich eine XML-Datei bekomme, die so aussieht:

<books>
    <book>
        <author>Ralls, Kim</author>
        <title>Midnight Rain</title>
    </book>
    <book>
        <author>Corets, Eva</author>
        <title>Maeve Ascendant</title>
    </book>
    <book>
        <author>Corets, Eva</author>
        <title>Oberon's Legacy</title>
    </book>
    <book>
        <author>Randall, Cynthia</author>
        <title>Lover Birds</title>
    </book>
    <book>
        <author>Thurman, Paula</author>
        <title>Splish Splash</title>
    </book>
    <book>
        <author>Knorr, Stefan</author>
        <title>Creepy Crawlies</title>
    </book>
    <book>
        <author>Kress, Peter</author>
        <title>Paradox Lost</title>
    </book>
    <book>
        <author>Crichton, Michael</author>
        <title>Jurassic Park</title>
    </book>
    <book>
        <author>Orwell, George</author>
        <title>1984</title>
    </book>
    <book>
        <author>Martin, George</author>
        <title>A Song of Ice And Fire</title>
    </book>
</books>

Ich möchte diese 10 Bücher in einer Tabelle aus zwei Zeilen und fünf Spalten anzeigen.

Ich bin so weit gekommen:

<xsl:template match="books" mode="table">
    <fo:table margin-left="auto" margin-right="auto">
        <fo:table-body>
            <fo:table-row table-layout="fixed">
                <xsl:for-each select="skill">
                    <fo:table-cell border="1">
                        <fo:block font-weight="bold">
                            <xsl:value-of select="name"/>
                        </fo:block>
                    </fo:table-cell>    
                </xsl:for-each>
            </fo:table-row>
        </fo:table-body>
    </fo:table>
</xsl:template>

Aber alles, was dies tun wird, ist, jede Zelle in dieselbe Zeile zu setzen. Ich suche nach einer Möglichkeit, um zu überprüfen, ob die Schleife eine bestimmte Anzahl von Malen (5 oder 6) ausgeführt wurde, und eine neue Zeile einzufügen, wenn dies geschieht, aber ich weiß nicht, ob ich das in XSL tun kann.

Kann mich jemand in die richtige Richtung weisen?

Antworten auf die Frage(2)

Ihre Antwort auf die Frage