Next in thread → Next in month →

Re: [docbook] Custom Xref Formatting

From
"Cob Rtayton"
Date
2005-12-21T02:05:29+00:00
ID
04c701c605d2$f477a2b0$6400a8c0@toshiro
Thread
Re: [docbook] Custom Xref Formatting
Hi David,

Figure xrefs normally use the 
xref-number-and-title context, so that should get your xrefstyle 
working.

 

But the %t will resolve to the title on the 
figure element, not the xreflabel like you are hoping for.  That would 
require some additional customization in the xref template itself, or the 
template that matches figure in mode="xref-to", I think.

 

Bob Stayton
Sagehill Enterprises
DocBook Consulting


 

 

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

  
From: 
  David White 
  

  
To:  
  

  
Sent: Monday, December 19, 2005 1:33 
  PM

  
Subject: RE: [docbook] Custom Xref 
  Formatting

  

  

  
I have learned how to 
  call xrefstyles from my customization layer in order to choose a particular 
  style over another.  Here is an example:

  
 

  
<xref 
  linkend="i329971b" 
  xreflabel="1" xrefstyle="figcallout" />

  
 

  
However, the “figcallout” style, 
  which is in my customization layer doesn’t seem to take effect.  Am I 
  using this in the wrong fashion?

  
 

  
            
  <l:context name="xref-number">

  
                        
  <l:template name="figure" text="oooFigure&#160;%n"/>

  
                        
  <l:template name="figure" 
  style="figcallout" text="(Figure&#160;%n,&#160;(%t))"/>

  
            
  </l:context>

  
 

  

  

  
  

  
From: Bob 
  Stayton [mailto:] 
Sent: Monday, December 19, 2005 11:24 
  AM
To: David White; 
  
Subject: Re: [docbook] Custom Xref 
  Formatting

  
 

  

  
Hi 
  David,

  

  
Certainly it is 
  possible.  This would be a named xrefstyle, which the stylesheet would 
  handle per your specs.  The only question is where to put the callout 
  number (the second "1" in your example) since xref is an empty element.  
  It could go into a xreflabel attribute, which would be handled specially for 
  this xrefstyle.  So your code would then look like 
  this:

  

  
 

  

  
<xref 
  xrefstyle="figcallout" xreflabel="1"/>

  

  
 

  

  
 

  

  
Bob Stayton
Sagehill Enterprises
DocBook 
  Consulting


  

  
 

  

  
 

  
    

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

    

    
From: David White 
    

    

    
To:  
    

    

    
Sent: Monday, 
    December 19, 2005 8:54 AM

    

    
Subject: 
    [docbook] Custom Xref Formatting

    

    
 

    
I have 
    :

    
                                    
    <figure id="i329971b" pgwide="1">

    
                                                
    <title/>

    
                                                
    <mediaobject>

    
                                                            
    <imageobject>

    
                                                                        
    <imagedata fileref="file:///c: /0001126C.eps" contentwidth="6.500in" 
    contentdepth="3.386in"/>

    
                                                            
    </imageobject>

    
                                                
    </mediaobject>

    
                                    
    </figure> 
    

    
 

    
And I’m using the 
    following <xref> to reference this 
figure.

    
 

    
<emphasis 
    role="strong">(<xref xrefstyle="select: label" 
    linkend="i329971b"/>,(1))</emphasis>

    
 

    
This generates an 
    output like this: (Figure 1,(1)) 
    ß the “1” changes 
    the rest of the text is fixed.

    
 

    
Is there a better 
    way to reduce the amount of code used in my <xref> statement?  
    I’ve tried to add custom formatting but it doesn’t seem to take 
    effect.

    
 

    
What I would like 
    to achieve is something like this (making up my own tag 
    here):

    
<xref 
    xrefstyle=”template: figurewparens” linkend=”i329971b” 
    value=”1”/>   to output (Figure 
    1,(1))

    
 

    
Is this 
    possible?

    
 

    
Thanks,

    
 

    
David 
    White
Next in thread → Next in month →