Variables in xsl:use-attribute-sets

Hi,

I need to display keywords and phrases that are tagged using <txtstyle
type="someStyle">.  My input XML looks like this.
<p>This is a <txtstyle type="style1">command</txtstyle> that I want
displayed in a certain style. This is a second <txtstyle
type="style2">command</txtstyle> that I want displayed in another
style...</p>


The corresponding styles are defined in a group of <xsl:attribute-set>
tags.  
<xsl:attribute-set name="style1">
	<xsl:attribute name="color">red</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="style2">
	<xsl:attribute name="color">blue</xsl:attribute>
</xsl:attribute-set>
...

I have defined a variable in the template to read the "type" attribute
value of the txtstyle element (i.e., style name) from the xml document.
I want to be able to use the value of the variable to call the attribute
set. 
<xsl:template match="txtstyle">
	<xsl:variable name="myStyle">
		<xsl:value-of select="@type"/>
	</xsl:variable>
	<xsl:if test="@type = $myStyle">
		<fo:inline xsl:use-attribute-sets="$myStyle">
			<xsl:apply-templates/>
		</fo:inline>
	</xsl:if>
</xsl:template>

However, the output file contains the <fo:inline>tagged text</fo-inline>
without the appropriate attributes as follows:
<fo:block>This is a <fo:inline>command</fo:inline> that I want displayed
in a certain style. This is a second <fo:inline>command</fo:inline> that
I want displayed in another style...</fo:block>

I would appreciate any help on this problem.
Thanks,


Marilu
 
Marilu A. Hoeppner, Ph.D.
National Center for Biotechnology Information (NCBI)
Tel: 301-496-4911

Received on Thursday, 1 May 2003 14:14:21 UTC