Subject: Re: [xsl] Reusing XML content as I publish From: "Joris Gillis" <roac@xxxxxxxxxx> Date: Fri, 28 Jan 2005 17:59:56 +0100 |
What I want to do is pick up the text from one of the terms and reuse it elsewhere in the document by referencing just the glossary item "name", and getting the term and definition as part of a 'tooltip.'
from input xml: <root> <glossary> <alphagroup> <alphahead>A</alphahead> <glossaryitem name="Allocate"> <term>Allocate Stuff</term> <definition> <para>Stuff about allocations</para> </definition> </glossaryitem> </alphagroup> </glossary> <body> You can then <glossarytt name="Allocate" width="200">Allocate</glossarytt> resources </body> </root>
<xsl:template match="/"> <html> <body> <xsl:apply-templates select="root/body"/> </body> </html> </xsl:template>
<xsl:template match="glossarytt "> <xsl:apply-templates select="key('glossary',@name)"/> </xsl:template>
<xsl:template match="glossaryitem"> <a href="#" class="tooltip {@name}"> <xsl:value-of select="term"/> <span> <xsl:apply-templates select="definition"/> </span> </a> </xsl:template>
regards, -- Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041) Deserta faciunt et innovationem appelant
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Reusing XML content as I , Nicola Harlow | Thread | RE: [xsl] Reusing XML content as I , Wendell Piez |
Re: [xsl] Relative XPATH between 2 , David Carlisle | Date | RE: [xsl] XSL Newbie: How2 write tr, Wendell Piez |
Month |