Re: [docbook-apps] issue with 1.79.1 stylesheets and table id

From
Tim Arnold <>
Date
2016-02-16T18:02:25+00:00
ID
Thread
Re: [docbook-apps] issue with 1.79.1 stylesheets and table id
hi Bob, thanks!
I must still be doing something wrong since I keep getting that attribute. Here is my test.xsl customization layer:

<?xml version='1.0'?>

<xsl:stylesheet

    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

    version="1.0">

  <xsl:import href="">

  <xsl:template mode="htmlTableAtt" select="xml:id" />

</xsl:stylesheet>

any ideas on what I'm doing wrong?

thanks,

--Tim

On Tue, Feb 16, 2016 at 12:12 PM, Bob Stayton <> wrote:
Hi Tim,

Yes, this is a bug.  In DocBook 5, HTML-coded tables were allowed to have attributes with HTML attribute names such as @onmouseover, and they were expected to be passed through to the HTML table output.  To support such attributes, version 1.79.1 added a template that starts with this:

<!-- copy these through -->

<xsl:template mode="htmlTableAtt"

              match="@abbr

                   | @align

                   | @axis

                   ...

which copies those attributes through.  Unfortunately, it mistakenly includes xml:id, which should not be there, because the id is output elsewhere.

So the workaround for you is to add this to your customization layer:

<xsl:template mode="htmlTableAtt" select="xml:id" />

Bob Stayton

Sagehill Enterprises



On 2/16/2016 7:47 AM, Tim Arnold wrote:

I'm using the 1.79.1 html stylesheets with the following example

document I get an "xml:id" attribute on the resulting html table.

That attribute causes some problems for me further down the processing

line. This didn't occur with the 1.78.1 stylesheets. I'm guessing that

this is a bug?

Here's the example:

<chapter xnlns="http://docbook.org/ns/docbook" version="5.0" xml:id="test">

<info><title>My Chapter</title></info>

   <para>

     <table xml:id="one.two.three">

       <caption>My Table</caption>

       <tr><th>column 1</th><th>column 2</th></tr>

     </table>

   </para>

</chapter>

I get xml:id on the resulting html table, using this command line:

xsltproc/path/to/docbook/xsl-1.79.1/html/docbook.xsl test.xml

<div class="table">

   <a name="one.two.three"></a>

   <p class="title"><b>Table▒1.1.▒My Table</b></p>

   <div class="table-contents">

     <table*xml:id="one.two.three"*>

       <tr><th>column 1</th><th>column 2</th></tr>

     </table>

   </div>

</div>

When I change to the 1.78.1 stylesheets:

xsltproc /path/to/docbook/xsl-1.78.1/html/docbook.xsl test.xml

The output is okay:

<div class="table">

   <a name="one.two.three"></a>

   <p class="title"><b>Table▒1.1.▒My Table</b></p>

   <div class="table-contents">

     <table>

       <tr><th>column 1</th><th>column 2</th></tr>

     </table>

   </div>

</div>

Is there something I can do outside of postprocessing the html to omit

that attribute?

thanks,

--Tim