This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Re: a newbie struggling
- From: Peter Davis <pdavis152 at attbi dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Tue, 30 Apr 2002 00:28:25 -0700
- Subject: Re: Re: [xsl] a newbie struggling
- References: <747DEA47.22CA675C.C6D0F0B0@netscape.net>
- Reply-to: xsl-list at lists dot mulberrytech dot com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Monday 29 April 2002 21:59, pandianoliver@netscape.net wrote:
> I am converting the xml/xslt document to pdf using fop.
>
> >> How can I go through the document and replace subscript with the tag
> >> <sub>value</sub> to the actual subscript?
> >
> >What does this mean?
>
> ex: in the xml document I have the tag 5<sup>2</sup>. with the xslt
> transformation, I would like to see 5 tothepowerof 2. Hope this makes
> sense...
I don't know much about XSL/FO, but I think you want to use a template that
matches the "<sup>" element:
<xsl:template match="sup">
<fo:inline baseline-shift="super" font-size=".75em">
<xsl:apply-templates/>
</xsl:fo>
</xsl:template>
Whenever you apply-templates on a <sup> element, that template will output a
<fo:inline> element (replace this with whatever fo tag you want, I'm probably
wrong), and then it apply-templates to the *children* of the <sup> element.
If <sup> contains the text "value", the effect will be that it outputs
<fo:inline ...>value</fo:inline>
Hope that helps!
- --
Peter Davis
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE8zkeZNSZCJx7tYycRAvz+AKCj6e3fS+UJ3lH44rXEJfF2DSKZrQCdFB//
um/TVZvzYIFYcqdwD5riGd8=
=/Cfc
-----END PGP SIGNATURE-----
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list