[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Article title in chunked HTML files
Sorry for being nerving, but I'm relatively new to all that XSL stuff.
Now I have the following piece of code in my customization layer:
<xsl:template name="user.header.content">
<xsl:if test="parent::*">
<xsl:apply-templates select="/*" mode="object.title.markup"/>
<h1 class="title">
<xsl:copy-of select="$title"/>
</h1>
</xsl:if>
</xsl:template>
And I still get the error message "Error at xsl:copy-of on line 61 of
file:/c:/docbook/stylesheet/document_openpgp_chunk.xsl: Variable title
has not been declared
Any ideas?
B.
Bob Stayton wrote:
>As you discovered, variables are local to each template in XSLT.
>You would need to use the template that generates the title:
>
><xsl:apply-templates select="/*" mode="object.title.markup"/>
>
>That will process the root element to get its title.
>
>Yes, it would appear in the index.html, unless you make it conditional. You
>can do that by checking to see if the current element has a parent:
>
><xsl:if test="parent::*">
> <xsl:apply-templates etc.
>
>The index.html file is generated by the root element, which has no parent.
>
>Bob Stayton
>Sagehill Enterprises
>DocBook Consulting
>bobs@sagehill.net
>
>
>----- Original Message -----
>From: "Bernd Pörner" <bernd.poerner@imformgroup.com>
>To: "Bob Stayton" <bobs@sagehill.net>
>Cc: <docbook-apps@lists.oasis-open.org>
>Sent: Thursday, October 14, 2004 3:23 AM
>Subject: Re: [docbook-apps] Article title in chunked HTML files
>
>
>
>
>>Bob Stayton wrote on 20.09.2004 06:38:
>>
>>
>>
>>>You could use the 'user.header.content' template to add an H1 heading to
>>>every chunked file.
>>>
>>>
>>>
>>>
>>I've tried that by adding the following lines to my customization layer:
>>
>><xsl:template name="user.header.content">
>><h1>
>><xsl:copy-of select="$title"/>
>></h1>
>></xsl:template>
>>
>>When I fire up my Saxon, I get the following error message:
>>
>>"Error at xsl:copy-of on line 59 of
>>file:/c:/docbook/stylesheet/document_openpgp_
>>chunk.xsl: Variable title has not been declared"
>>
>>BTW: Without this customization, the document title is displayed as <H1>
>>header in the index.html chunk. Wouldn't this mean that in the case that
>>the customization described above would work, the document title would
>>be displayed two times in the index.html chunk?
>>
>>B.
>>
>>
>>
>>>To merge the document title with each section title, you could customize
>>>
>>>
>the
>
>
>>>template named 'section.heading' from html/sections.xsl to output the
>>>document title before the section title. For chapters and other
>>>component-level elements, you would also need to customize the template
>>>named 'component.title' in html/component.xsl in a similar manner.
>>>
>>>Bob Stayton
>>>Sagehill Enterprises
>>>DocBook Consulting
>>>bobs@sagehill.net
>>>
>>>
>>>----- Original Message -----
>>>From: "Bernd Pörner" <bernd.poerner@imformgroup.com>
>>>To: <docbook-apps@lists.oasis-open.org>
>>>Sent: Thursday, September 16, 2004 1:22 PM
>>>Subject: [docbook-apps] Article title in chunked HTML files
>>>
>>>
>>>
>>>
>>>
>>>
>>>>Dear all,
>>>>
>>>>one more question before I go on holiday:
>>>>
>>>>In chunked HTML files, the title of a DocBook document is only displayed
>>>>in the <title> section and as <h1> header of/in the first (the
>>>>index.html) file.
>>>>
>>>>My question:
>>>>
>>>> * How to place the document title as <h1> header in every chunked
>>>>
>>>>
>>>>
>>>>
>>>file?
>>>
>>>
>>>
>>>
>>>> * How to place the document title in the <title> section of every
>>>> chunked file, in the following format: "document_title -
>>>> section_title_of_chunk_file"?
>>>>
>>>>Cheers
>>>>B.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>
>>
>
>
>
>
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]