473,809 Members | 2,791 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Displaying the degree symbol using XSLT

I am finding that when I use XSLT to display convert XML like this:

<temp units="°C">23</temp>

the resulting HTML displays an extra character in front of the degree
symbol, like this:

23°C

This happens whether I use PHP or ASP so it seems to be
parser-independent. The XSL fragment would be something like:

<xsl:value-of select="@units"/>

Can anyone explain what's going on? I'm trying to develop XML files
containing weather info, and example XSLT to format and display them,
and this is a bit of a speedbump.

The XML displays as expected in IE 6, ie like this:

<temp units="°C">23</temp>

Thanks for any help.

Dingbat
Jul 20 '05 #1
1 5867

That's the UTF8 encoding. So you either need to make sure that you are
serving the file with the http headers declaring utf8 (and make sure
that your browser understands that encoding) or perhaps you want to
output in latin1 or ascii in which case adding
<xsl:output encoding="iso-8859-1"/> or
<xsl:output encoding="US-ASCII"/>
probably works (it depends how you are calling xslt, if the final
serialisation is being done by some other application than the xslt
engine, encoding hints on xsl:output are likely to be ignored)

David

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1980
by: Barry Anderberg | last post by:
I have an XML document that I am trying to display in my ASP.NET page. I am using an XSL Transform to display repeating XML data in a specific format. It reads the data, and displays it on my page, but there's a problem. It runs all the data together on one line. The XSL file is as follows:
4
2759
by: Stephen | last post by:
I have an xml document with a xsl stylesheet. It will display the styles in explorer, but not in netscape 7.1 <?xml version="1.0" standalone="no"?> <!DOCTYPE home SYSTEM "A:\xmlproject\home.dtd"> <?xml-stylesheet type="text/xsl" href="A:\xmlproject\home.xsl"?> Any ideas why?
0
1301
by: Anthony Harkness-Gripe | last post by:
This is a very simple XSLT, and I'm doing it ways that I've had work before, but it's not displaying HTML. Is there a flaw in my logic? C#: ------------------------------------------------------------------- // context is current HttpContext System.Xml.XmlTextWriter xmlw = new XmlTextWriter(context.Response.Output); // See XML below for CustomDataSet
5
7070
by: SalamElias | last post by:
I followed instructions in MSDN help articles and wrotethe folowing code in order to display numeric numbers with Euro symbol as follows : ---------------------------- Dim OutString As = "" Dim frCulture As New CultureInfo("fr-FR", False) Thread.CurrentThread.CurrentCulture = frCulture Dim myCurrency As New (123456) myCurrency.ToString("C", LocalFormat) OutString = "Euro : " + myCurrency.ToString("C", NumberFormatInfo.CurrentInfo)
3
11373
by: Neal | last post by:
VC++ VS 2003 I am currently finishing up a weather bug program that receives data from the weather.com weather feed, just need some finishing touches. The one issue I have run into seems to be a simple one in the grand scheme of things. How do I go about printing a degree symbol for the temperature? Is there an ASCII code for it, or some sort of shortcut key? I want to add it to a string so I can print it out in a label with the rest...
3
1721
by: Rusty | last post by:
Hi, our intranet web site needs to add this feature. I've got the components but just need the last step to get it going. Here's the setup. 1) a user clicks on a link which calls a web service (I will use AJAX if necessary) 2) the web service returns a string datatype which is filled with well-formed XML 3) I have an XSLT transform which outputs HTML (i tested it with a tool called XFactor (www.nombas.com). Pretty cool tool, I write...
38
5085
by: ted | last post by:
I have an old link that was widely distributed. I would now like to put a link on that old page that will go to a new page without displaying anything.
1
4229
by: littlealex | last post by:
IE6 not displaying text correctly - IE 7 & Firefox 3 are fine! Need some help with this as fairly new to CSS! In IE6 the text for the following page doesn't display properly - rather than being aligned to the top, along with the slideshow and link buttons, you have to scroll down to see the text - how can I make IE6 display correctly? http://geekarama.co.uk/new_home.html here is the code for new_home.html and following that the CSS...
3
1281
by: =?Utf-8?B?UmljaA==?= | last post by:
I copied a down arrow triangle symbol from the character map and added this symbol to a menu Item on a menustrip on a form in my app. On saving the project a dialogbox asked if I wanted to convert/save to unicode - or something like that. I clicked yes and then deployed the app (using Click Once). On a user's workstation I noticed that this triangle symbol was not displaying and in its place was a little empty sqare (indicating the...
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9601
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10635
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10115
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3013
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.