OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] Table Auto numbering template fails with namespaces but is fine otherwise


Thanks Bob,

That worked and my modified file follows.

Cheers,
Carlton.

===html_ns.xsl============================================
<?xml version='1.0'?>
<xsl:stylesheet
		xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
		xmlns:d="http://docbook.org/ns/docbook";
		version="1.0"
>

<xsl:import href="../../docbook-xsl-ns-1.75.1/xhtml/docbook.xsl"/>
<xsl:template match="processing-instruction('ns')">NS</xsl:template>
<xsl:template match="processing-instruction('count')">
    <xsl:number count="d:tr" format="1" />
</xsl:template>

</xsl:stylesheet>
=======================================================

On Tue, Jun 16, 2009 at 10:44 AM, Bob Stayton<bobs@sagehill.net> wrote:
> Hi Carlton,
> Indeed, namespace is the issue. The element tr in  that you reference in
> <xsl:number count="tr" format="1" />
> needs its namespace prefix (and the stylesheet needs the namespace
> declaration for that prefix). That means you need to copy that template from
> html_common.xsl to html_ns.xsl so you can add the namespace there.
>
> Bob Stayton
> Sagehill Enterprises
> bobs@sagehill.net
>
>
> ----- Original Message ----- From: "Carlton Joseph"
> <carlton.joseph@gmail.com>
> To: <docbook-apps@lists.oasis-open.org>
> Sent: Monday, June 15, 2009 3:55 PM
> Subject: [docbook-apps] Table Auto numbering template fails with namespaces
> but is fine otherwise
>
>
>> Hello Folks,
>>
>> I have two question.
>> 1 - Why does my table auto-numbering scheme not work with namespaces
>> 2 - Is the way I do table numbering the recommended method
>>
>> xsltproc -o test.html html.xsl test.dbk
>> works and generates tables numbers
>>
>> xsltproc -o test_ns.html html_ns.xsl test.dbk
>> no table numbers are generated.
>>
>> My file are at the end of this email.
>>
>> I am guessing my template need to be specified with the namespace
>> and I do not know how to do that.
>>
>> Thanks for your help in advance,
>> Carlton.
>>
>> ===test.dbk============================================
>> <?xml version="1.0" encoding="UTF-8"?>
>> <article
>> xmlns="http://docbook.org/ns/docbook";
>> version="5.0"
>> xmlns:xi="http://www.w3.org/2001/XInclude";
>>>
>>
>> <title>Table Numbering - <?ns?></title>
>>
>> <table frame="box" rules="all">
>> <thead><tr><th>Step</th><th>Action</th></tr></thead>
>> <tr><td><?count?></td><td>Do A.</td></tr>
>> <tr><td xml:id="loop"><?count?></td><td>Do B.</td></tr>
>> <tr><td><?count?></td><td>Do C.</td></tr>
>> <tr><td><?count?></td><td>Goto step <xref linkend="loop"
>> endterm="loop"/></td></tr>
>> </table>
>>
>> </article>
>> ===html_common.xsl========================================
>> <?xml version='1.0'?>
>> <xsl:stylesheet
>> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
>> version="1.0"
>>>
>>
>> <xsl:template match="processing-instruction('count')">
>>   <xsl:number count="tr" format="1" />
>> </xsl:template>
>>
>> </xsl:stylesheet>
>> ===html.xsl==============================================
>> <?xml version='1.0'?>
>> <xsl:stylesheet
>> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
>> version="1.0"
>>>
>>
>> <xsl:import href="../../docbook-xsl-1.75.1/xhtml/docbook.xsl"/>
>> <xsl:import href="html_common.xsl"/>
>> <xsl:template match="processing-instruction('ns')">No-NS</xsl:template>
>>
>> </xsl:stylesheet>
>> ===html_ns.xsl============================================
>> <?xml version='1.0'?>
>> <xsl:stylesheet
>> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
>> version="1.0"
>>>
>>
>> <xsl:import href="../../docbook-xsl-ns-1.75.1/xhtml/docbook.xsl"/>
>> <xsl:import href="html_common.xsl"/>
>> <xsl:template match="processing-instruction('ns')">NS</xsl:template>
>>
>> </xsl:stylesheet>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
>> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
>>
>>
>>
>
>


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]