Reputation: 63
i have an XML file which looks like this:
<description>Some description<tt>some more description</tt> even more description</description>
In my XSL file I get the data from the description tag by this:
<xsl:value-of select="Description"/>
The result is the FO document is
Some description<tt>some more description</tt> even more description
How can I make my XSL-Stylesheet interpret the text between the
<tt>
tags as "italic" or some other text styles like "bold" or so?
Upvotes: 1
Views: 135
Reputation: 1493
given your XML as:
<description>Some description<tt>some more description</tt> even more description</description>
this:
<xsl:template match="description/tt">
<span style="font-style: italic">
<xsl:value-of select="string(.)"/></span>
</xsl:template>
will produce output as:
Some description
some more description
even more description
Upvotes: 2
Reputation: 117073
How can I make my XSL-Stylesheet interpret the text between the
<tt>
tags as "italic" or some other text styles like "bold" or so?
You could do this by writing a template that matches tt
, for example:
<xsl:template match="tt">
<italic>
<xsl:apply-templates/>
</italic>
</xsl:template>
--
<xsl:value-of select="Description"/>
does NOT return:
Some description<tt>some more description</tt> even more description
Upvotes: 1