You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by "Sachdeva, Rajeev" <Sa...@logica.com> on 2002/12/03 12:26:25 UTC
special character
Hi,
Does anyone know how to display special character in Input element text line
?
Code snippet in xsl :
<xsl:variable name="special_character">Å</xsl:variable>
<xsl:element name="INPUT"> <!-- INPUT -->
<xsl:attribute name="name">test</xsl:attribute>
<xsl:attribute name="value">
<xsl:value-of select="$special_character"/>
</xsl:attribute>
</xsl:element>
Expected result : Å
Acutal Output in Input element : %c5 <-- Wrong
How to display Å instead of %c5 in HTML Input element ?
Thanks for your help.
Regards.
Rajeev Sachdeva
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
RE: special character
Posted by Antony Quinn <an...@caret.cam.ac.uk>.
Rajeev,
There are two methods you could use:
1. Use &#197; instead of Å ie:
<xsl:variable name="special_character">&#197;</xsl:variable>
2. Use an ENTITY declaration, e.g.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY special-character "Å">
]>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:template match="/">
<xsl:element name="INPUT">
<xsl:attribute name="name">test</xsl:attribute>
<xsl:attribute name="value">&special-character;</xsl:attribute>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
Regards,
Antony
P.S. A simpler method to produce an INPUT tag is as follows:
<xsl:template match="/">
<INPUT name="test" value="&special-character;"/>
</xsl:template>
-----Original Message-----
From: Sachdeva, Rajeev [mailto:SachdevaR@logica.com]
Sent: 03 December 2002 11:26
To: 'xalan-j-users@xml.apache.org'
Subject: special character
Hi,
Does anyone know how to display special character in Input element text line
?
Code snippet in xsl :
<xsl:variable name="special_character">Å</xsl:variable>
<xsl:element name="INPUT"> <!-- INPUT -->
<xsl:attribute name="name">test</xsl:attribute>
<xsl:attribute name="value">
<xsl:value-of select="$special_character"/>
</xsl:attribute>
</xsl:element>
Expected result : Å
Acutal Output in Input element : %c5 <-- Wrong
How to display Å instead of %c5 in HTML Input element ?
Thanks for your help.
Regards.
Rajeev Sachdeva
This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be copied,
disclosed to, retained or used by, any other party. If you are not an
intended recipient then please promptly delete this e-mail and any
attachment and all copies and inform the sender. Thank you.