W3C home > Mailing lists > Public > www-xsl-fo@w3.org > July 2007

Can I do this with the Key function?

From: Roger Parkinson <roger@senanque.co.nz>
Date: Fri, 20 Jul 2007 12:41:30 +1200
Message-ID: <46A004BA.8010304@senanque.co.nz>
To: www-xsl-fo@w3.org

I'm using XSL to generate a PDF with FOP but I think this is more XSL 
than FO.

I have this in my XML file:
...
        <references>
            <reference n="[1]" t="some text"/>
        </references>
....
    <referenceLink t="some text"/>
....

My XSL file has this:
 ...
        <xsl:key name="references" match="reference" use="@t"/>
...
        <xsl:template match="referenceLink">
            <fo:wrapper font-style="italic">
                 <xsl:for-each select="key('references',@t)">
                    <fo:inline><xsl:text>reference 
</xsl:text><xsl:select value-of="@n"/></fo:inline>
                 </xsl:for-each>
            </fo:wrapper>
        </xsl:template>
...

What I want to have happen is the <referenceLink> tag to generate 
'reference [1]' . But it generates  just 'reference', ie it does not 
find the attribute @n on the <reference> tag. Reading the docs suggested 
to me that it would. What did I miss?

Thanks for any help.
Roger
Received on Friday, 20 July 2007 00:41:08 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 October 2007 16:06:14 GMT