Każdy autor ma atrybut id.
A każda książka ma jednego lub więcej autorów.
Autorzy Ci zdefiniowani są za pomocą atrybutu typu IDREFS zawierającego jeden lub kilka ID autorów.
<xsl:key name="preg" match="autor" use="./@id"/> <xsl:template match="/"> <html> <body> <table border="1"> <tr bgcolor="#9acd32"> <th>Tytuł</th> <th>Autor</th> </tr> <xsl:for-each select="//książki/książka"> <tr> <td><xsl:value-of select="tytuł"/></td> <xsl:variable name="autorzy" select="@autorzy"/> <xsl:for-each select="str:tokenize($autorzy, ' ')" xmlns:str="http://exslt.org/strings"> <td><xsl:value-of select="key('preg',./text())/@imie"/></td> </xsl:for-each> </tr> </xsl:for-each> </table> </body> </html> </xsl:template>
w środku drugiego for-eacha kiedy w select jest poptostu "." to wypisuje mi te ID ale kiedy chcę wyciągnąć elementy a z nich atrybut imie to nic nie wyciąga.
Co robię źle?