Есть XML
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="Authors.xsl"?>
<catalog>
<author>Petrov, Petr</author>
<author>Ivanov, Ivan</author>
<author>Andreev, Andrey</author>
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications
with XML.</description>
</book>
<book id="bk102">
<author>Ralls, Kim</author>
<title>Midnight Rain</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2000-12-16</publish_date>
<description>A former architect battles corporate zombies,
an evil sorceress, and her own childhood to become queen
of the world.</description>
</book>`
Необходимо вывести таблицу, с заголовками и двумя столбцами: авторы католога и авторы книг. Строки могут повторяться и нельзя использовать for-each.
Пока додумался до такого
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template match="catalog/book">
<HTML>
<BODY>
<TABLE border="1" >
<TR >
<TD width = "500"><xsl:apply-templates select="author" /></TD>
<TD width = "500"><xsl:apply-templates select="../author" /></TD>
</TR>
</TABLE>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
Но как можно добавить заголовки к столбацам, чтобы они не повторялись каждый раз?
должно получиться что-то типа этого, только надо добавить заголовки
select="сюда"
.