The above fix works only if the indexterm element appears after the
term name, i.e.:
<varlistentry xml:id="border-color">
<term>border-color
<indexterm xml:id="id8856773342938128">
<primary>themes</primary>
<secondary>border style properties</secondary>
<tertiary>border-color</tertiary>
</indexterm></term>
<listitem>
<para>Specifies the color of all four borders of an element.</para>
</listitem>
</varlistentry>
It does not work if the indexterm element appears before the term name:
<varlistentry xml:id="border-color">
<term>
<indexterm xml:id="id8856773342938128">
<primary>themes</primary>
<secondary>border style properties</secondary>
<tertiary>border-color</tertiary>
</indexterm>border-color</term>
<listitem>
<para>Specifies the color of all four borders of an element.</para>
</listitem>
</varlistentry>
Robert
On Wed, Aug 3, 2011 at 9:55 AM, Robert Pasternak <[email protected]> wrote:
> Hi Bob,
>
> I've added the above template to my customization layer and I'm
> getting something like this in my XHTML output:
>
> <div>
> <a href="../mcs_themes/theme_border_prop.html#border-color"
> class="olink"></a>
> <a id="id8856773342938128" class="indexterm"></a>
> border-color
> </div>
>
> and the link does not work.
>
> Thanks,
> Robert
>
> BTW. I use DocBook XSL version 1.75.1.
>
> On Tue, Aug 2, 2011 at 7:51 PM, Bob Stayton <[email protected]> wrote:
>> Hi,
>> This turns out to be a bug in how the cross reference text to a varlistentry
>> is generated. The indexterm in the term is generating an empty <a name>
>> anchor as part of the xref text. When that is wrapped with the <a href> to
>> make the link, that produces an invalid nested <a> and browsers don't
>> display it as a link.
>>
>> This template could be added to your customization layer to patch the
>> problem. I'll fix it in the XSL source files for the next release.
>>
>> <xsl:template match="d:varlistentry/d:term" mode="xref-to">
>> <xsl:param name="referrer"/>
>> <xsl:param name="xrefstyle"/>
>>
>> <xsl:apply-templates mode="no.anchor.mode"/>
>> </xsl:template>
>>
>> The mode="no.anchor.mode" causes it to omit indexterms from the xref text.
>>
>> Bob Stayton
>> Sagehill Enterprises
>> [email protected]
>>
>>
>> ----- Original Message ----- From: "Robert Pasternak" <[email protected]>
>> To: "Bob Stayton" <[email protected]>
>> Cc: <[email protected]>
>> Sent: Monday, August 01, 2011 11:50 PM
>> Subject: Re: [docbook-apps] olinking to varlistentry with indexterm inside
>> term
>>
>>
>> Hi,
>>
>> I use xhtml/profile-chunk.xsl.
>>
>>
>> Robert
>>
>> On Mon, Aug 1, 2011 at 8:07 PM, Bob Stayton <[email protected]> wrote:
>>>
>>> Hi,
>>> It works for me in PDF output. Does your XML file validate? You didn't
>>> mention what kind of output you are generating.
>>>
>>> Bob Stayton
>>> Sagehill Enterprises
>>> [email protected]
>>>
>>>
>>> ----- Original Message ----- From: "Robert Pasternak" <[email protected]>
>>> To: <[email protected]>
>>> Sent: Monday, August 01, 2011 7:13 AM
>>> Subject: [docbook-apps] olinking to varlistentry with indexterm inside
>>> term
>>>
>>>
>>>> Hi,
>>>>
>>>> Let's consider the following XML fragment:
>>>>
>>>> <varlistentry xml:id="border-color">
>>>> <term>border-color</term>
>>>> <listitem>
>>>> <para>Specifies the color of all four borders of an
>>>> element.</para>
>>>> </listitem>
>>>> </varlistentry>
>>>>
>>>> When I use <olink targetptr="border-color"/>, then the link to the
>>>> varlistentry is created properly.
>>>> Now, if there is an indexterm element like this:
>>>>
>>>> <varlistentry xml:id="border-color">
>>>> <term>
>>>> <indexterm xml:id="id8856773342938128">
>>>> <primary>themes</primary>
>>>> <secondary>border style properties</secondary>
>>>> <tertiary>border-color</tertiary>
>>>> </indexterm>border-color</term>
>>>> <listitem>
>>>> <para>Specifies the color of all four borders of an
>>>> element.</para>
>>>> </listitem>
>>>> </varlistentry>
>>>>
>>>> then the same <olink targetptr="border-color"/> does not generate a
>>>> link, even though it properly outputs the label, i.e. "border-color"
>>>> text.
>>>>
>>>> Any ideas what's wrong with my docbook page?
>>>>
>>>> Robert
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [email protected]
>>>> For additional commands, e-mail: [email protected]
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]