RE: [xsl] entities in transformations to html

Subject: RE: [xsl] entities in transformations to html
From: <Jarno.Elovirta@xxxxxxxxx>
Date: Mon, 24 Jan 2005 09:05:15 +0200
Hi,

> This is a generic question about what can be the best way to solve a
> simple problem. I have a database where i store different
> texts, that i
> export in xml an then transform in different formats using xslt.
>
> 1) Most of this texts are in Italian, so i have to use
> entities in html
> transformations (some user may not be able to support iso-8859-1)
>
> 2) i should need to transform texts in plain .txt or wap or something
> oother, so may be a bad idea to use html entities directly in the xml
> input processed via xslt
>
> 3) there are many html entities that i use rarely (arrows, Greek
> characters,ecc), but can be usefull in some cases...
>
> more specificly the question is:
>   -> is there in xslt any macro instruction similar to the php
> htmlenties(): a function that transform any special character of a
> string in the corresponding html entity?

No.

> ->if not, what can i do?

If your XSLT processor support ASCII output, use for serialization (encoding
attribute on xsl:output element). Non-ASCII characters will be serialized as
character entities or entity references.

Cheers,

Jarno

Current Thread