0

I have XSLT

<xsl:if test="progression = -1"><!--Insert character here-->/Down</xsl:if>
<xsl:if test="progression = 0"><!--Insert character here-->/No Change</xsl:if>
<xsl:if test="progression = 1"><!--Insert character here-->/Up</xsl:if>

I need to insert up, down and left right arrows in my xslt. The unicode are 2191, 2193, 2194 respectively.

enter image description here

How to I do it?

Nikhil Agrawal
  • 47,018
  • 22
  • 121
  • 208
  • http://stackoverflow.com/questions/9328882/encoding-special-chars-in-xslt-output http://stackoverflow.com/questions/12579537/keep-nbsp-and-other-special-characters-in-xslt-output-with-apply-templates http://stackoverflow.com/questions/18095587/transforming-xml-and-preserving-unicode-characters-with-xslt –  Oct 09 '13 at 09:56
  • Copy the character and paste it in the XSLT file. Where is the problem? – Tomalak Oct 09 '13 at 10:40
  • @Tomalak: it shows `?` for that character. – Nikhil Agrawal Oct 09 '13 at 13:22
  • Do you save your XSLT file as UTF-8? Does it say so in the XML declaration (`encoding="UTF-8"`)? Is your further processing pipeline in that encoding, too? – Tomalak Oct 09 '13 at 13:38

2 Answers2

0

If the question is how to insert the character, just type it, or copy it from Character map. .NET uses Unicode for strings so anything you save as Unicode, remains Unicode. You just have to make sure you save your file as some Unicode encoding, eg UTF8 instead of ASCII.

Whether the users will be able to see the character is another matter. At the very least, you'll have to save the resulting XML as a Unicode format as well (UTF-8). If you want to display the result in a web page, the page's encoding should be UTF8 as well.

Panagiotis Kanavos
  • 120,703
  • 13
  • 188
  • 236
0

To overcome this problem I did this

<xsl:if test="progression = -1">&#x2193;/Down</xsl:if>
<xsl:if test="progression = 0">&#x2194;/No Change</xsl:if>
<xsl:if test="progression = 1">&#x2191;/Up</xsl:if>
Nikhil Agrawal
  • 47,018
  • 22
  • 121
  • 208