[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Support for sortable HTML tables?
On Fri, Jan 05, 2007 at 02:02:50AM +0000, W. Borgert wrote:
> there is a nice little piece of JavaScript to make an HTML table
> sortable: http://kryogenix.org/code/browser/sorttable/
...
> I would like to use this feature in files generated from DocBook
> sources
...
I found a solution myself, but unfortunately, I have to copy the
complete "tgroup" template from xhtml/table.xsl into my
customisation file:
<xsl:template name="user.head.content">
<script type="text/javascript" src="sorttable.js"/>
</xsl:template>
<xsl:template match="tgroup" name="tgroup">
...
<table>
<!-- new code here: -->
<xsl:if test="../../*[@role='sortable']">
<xsl:attribute name="class">sortable</xsl:attribute>
<xsl:attribute name="id">
<xsl:value-of select="generate-id(.)"/>
</xsl:attribute>
</xsl:if>
<!-- that's it -->
<xsl:choose>
...
Two questions:
- is role="sortable" the philosophically correct way of doing
things like this?
- (how) can I avoid copying ~280 lines from xhtml/table.xsl?
Cheers, WB
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]