Re: [xsl] a newbie struggling

Subject: Re: [xsl] a newbie struggling
From: Peter Davis <pdavis152@xxxxxxxxx>
Date: Mon, 29 Apr 2002 21:31:00 -0700
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 29 April 2002 20:28, pandianoliver@xxxxxxxxxxxx wrote:
>  I am working on XML/XSLT.

What else are you working with?

> How can I go through the document and replace subscript with the tag
> <sub>value</sub> to the actual subscript?

What does this mean?  Do you want to replace the word "value" with 
"<sub>value</sub>"?  What determines that something is subscript and needs to 
be replaced/modified?  Without knowing this, I can't tell you how to replace 
it.

> I also need the decimal code
> &#916; to be changed to the delta sign all throughout the document?

In XML, &#916; is identical to a delta sign in every way as far as the 
application is concerned.  It is perfectly legal for the processor to 
represent that character as a character entity in XML.  The only way to turn 
this off using standard XSLT (other than a processor-specific way; for 
example, Saxon lets you control this using special parameters) is to use 
either something like:

<xsl:text disable-output-escaping="yes">&#916;</xsl:text>

or, if the &#916; is coming from the source document, something like:

<xsl:value-of select="/xpath/to/theTextContainingDelta" 
disable-output-escaping="yes"/>

Note that disable-output-escaping is not required to work, and a lot of people 
will flame me for telling you to use it (I always try to avoid it myself), so 
really there is no good way to do this without knowing which processor you 
use.

You could also do <xsl:output mode="text"/> if the rest of your output is not 
HTML or XML.

- -- 
Peter Davis
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8zh4FNSZCJx7tYycRAtyfAJ9dd+mXd8RE7zvkGT8zd024gKgzEgCg17MI
/VdrBG6iIsvW/5OOyrMqnQE=
=yOZZ
-----END PGP SIGNATURE-----


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


Current Thread