Re: [xsl] Numbering cross refs

Subject: Re: [xsl] Numbering cross refs
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 11 Dec 2003 13:32:49 GMT

The way to get numbered cross refs to work is
1) get the numbering of the item (figure, chapter, table, ...)
   to work
2  when making the cross ref, go to the node that is referenced (with
   for-each or apply-templates in a special mode)
3) produce the number with the same code as in step 1.

In your case you have
  <xsl:number count="figure" level="any" from="mainfunc" format="1"/>
for step 1 so for step 2 you want
<xsl:template match="xref">
    <fo:basic-link background-color="lightblue"
    <xsl:text>Fig. </xsl:text>
    <xsl:for-each select="id(@xrefid)"/>

so at this point (assuming that you have a dtd and your figure ids are
of type ID so id() function works.) you are at teh figure, so now you
can do
 <xsl:number count="figure" level="any" from="mainfunc" format="1"/>

then just finish up

If you haven't declared your ids to be of type id you can declare a key
instead and use key() rather than id()

Without seeing a (small) input file I'm a bit confused as you have
which implies that your source doc has ids that you can use in teh
generated FO for cross referencing, but in teh figure itself
<xsl:template match="figure">
<xsl:template match="graphic">
you are not accessing any id attribute and using generate-id to put a
machine generated if into the FO which won't have any relationship to
the id used in your fo:basic-link.

I suspect you don't want id="{generate-id(.)}£ but instead 
or whatever the attribute is called that stores teh value taht is used
in the xrefid attribute of xref.



This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:

 XSL-List info and archive:

Current Thread