Xsl problem to find correct nodes using idrefs
XML / XSL
1
Posts
1
Posters
0
Views
1
Watching
-
Hi, I have a simple xml-structure to represent my bookcase.
lib + books + serie + book (aut: type = IDREFS) - title - pages + authors + author (id: type = ID) - first_name - last_name
It contains 2 tables, one of the authors identified with id. And a table with the books with an attribute aut pointing to one or more of the authors. Now i want to show the series, the booktitle and the author(s). The problems is how to show the author and not just the ID in the aut attribute. I have used a named template to find the author
<xsl:template name="author_name"> <xsl:param name="idref"/> <xsl:for-each select="//author[@id=$idref]"> <xsl:value-of select="last_name"/> <xsl:value-of select="first_name"/> </xsl:for-each> </xsl:template>
And I'm using it like this
<xsl:call-template name="author_name"> <xsl:with-param name="idref" select="@aut"/> </xsl:call-template>
And this works, BUT NOT for books written by 2 or more authors. I have tried tokenize but that function is only available in xls 2.0. And then IE has troubles with it. Any help on this would be appreciated.
Learn from the mistakes of others, you may not live long enough to make them all yourself.