Next in thread → Next in month →

Re: [docbook-apps] Q and A sets with olinks: no generated text

From
Bob Stayton <>
Date
2006-02-10T17:39:36+00:00
ID
025a01c62e68$ff78c860$6400a8c0@toshiro
Thread
Re: [docbook-apps] Q and A sets with olinks: no generated text
Hi,

The xrefstyle mechanism works with number 
labels and titles, but a qandaentry question does not have a title, just one or 
more para and other elements.  A question can be very long and complex, so 
the stylesheet doesn't try to use it for xrefs.

 

But if you restrict your questions to a 
single para, then you could create a customization to use them in xrefs.  
If you look at the template in fo/xref.xsl that starts with:

 

<xsl:template match="qandaentry" 
mode="xref-to">

That is the first template called when 
generating the text for an xref. It applies templates in 
mode="object.xref.markup" which uses the gentext mechanism.  In your case, 
you should create your own template that matches on question in 
mode="object.xref.markup" for processing the question. 

 

<xsl:template match="question" 
mode="object.xref.markup">

  <xsl:call-template 
name="gentext">
    <xsl:with-param name="key" 
select="'question'"/>
  </xsl:call-template>
  
<xsl:text> </xsl:text>
  <xsl:apply-templates select="para[1]/node()"/>

</xsl:template>

 

The select in the second-to-last line 
selects the content of the first para of the question.  If you just 
processed the para element itself, then you would get a para block output, not 
an inline output.

 

Bob Stayton
Sagehill Enterprises
DocBook Consulting


 

 

  
----- Original Message ----- 

  
From: 
  Zbyszek 
  Cybulski 

  
To: Docbook-Apps 

  
Sent: Friday, February 10, 2006 3:15 
  AM

  
Subject: [docbook-apps] Q and A sets with 
  olinks: no generated text

  

Hi list,

I have a collection of <qandaset> files, 
  which are used in master documents of the <article> type. I use olinks 
  to refer to different <qandaentry>s in these files. However, the 
  generated links in HTML output show only the question label and number, for 
  example: "Q:4." 

Is there any way to get, for example, "Q: What is 
  wrong with my olinks?"?
I haven't found anything on this issue in Bob's 
  book. I have played with different xrefstyle parameter values, but none of 
  them worked. 

Thanks in 
advance,

-Zbyszek
Next in thread → Next in month →