[solved] How to add custom table to xsl?

Discuss using and your tips/tricks for BookCAT
Post Reply
AlexK
Posts: 8
Joined: Mon Aug 03, 2020 6:21 pm

[solved] How to add custom table to xsl?

Post by AlexK » Thu Aug 20, 2020 12:00 pm

I've got a problem adding data from custom table to xsl. Any help would be appreciated ;)

So, I use table field Custom 19 like this:
2020-08-20_14-55-29.png
2020-08-20_14-55-29.png (56.96 KiB) Viewed 70 times
I'd like to list all the entries from this table for the given book in right or bottom panel.
How do I count entries?
I tried different variations, but none worked:
<xsl:if test="count(custom19/custom19)>0">
<xsl:if test="count(custom19/publishercustom)>0">
<xsl:if test="count(publishercustom/publishercustom)>0">
etc
How to get data field name?
Same here, I tried combining all the strings I have, none worked:
<xsl:value-of select="/data/fld/book/custom19/@name"/>
<xsl:value-of select="/data/fld/book/publishercustom/@name"/>
<xsl:value-of select="/data/fld/publishercustom/@name"/>
etc
Last edited by AlexK on Wed Sep 09, 2020 5:43 pm, edited 1 time in total.

AlexK
Posts: 8
Joined: Mon Aug 03, 2020 6:21 pm

Re: How to add custom table to xsl?

Post by AlexK » Wed Sep 09, 2020 5:43 pm

I found a solution.
Table Cutom 19 should be addressed as custom19list in xsd.
So layout for book can be something like that:
<xsl:if test="count(custom19list/custom19)>0">
<tr>
<td><xsl:value-of select="/data/fld/book/custom19/@name"/></td>
<td>
<xsl:for-each select="custom19list/custom19">
<xsl:value-of select="."/><xsl:text>, </xsl:text>
</xsl:for-each>
</td>
</tr>
</xsl:if>
Still I can't understand why value-of for @name have suddenly started to work.

Post Reply