This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: correction:How to do a subscript from <sup>-34</sup>


<pandianoliver@netscape.net>]

How can I go through my xml file and replace the following with subscript:
<sup>-34</sup>

[Tom P]

Assuming that you want to change that to

<sub>-34</sub>

you can use

<xsl:template match='sup'>
    <sub><xsl:value-of select='.'/></sub>
</xsl:template>

To make sure this template gets called, you will want to have some variation
of <xsl:apply-templates> in the stylesheet.

If there could also be child elements within the "sup" element, you could
use

<xsl:template match='sup'>
    <sub><xsl:apply-templates/></sub>
</xsl:template>


For sub- and super-scripts, probably not needed.

Cheers,

Tom P


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]