Transforming/Outputting special characters (e.g. alpha)
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 20
- Joined: Sat Nov 26, 2005 5:17 pm
- Location: Houston, Texas, USA
- Contact:
Transforming/Outputting special characters (e.g. alpha)
I have an XML source file that I transform through an XSL file.
When the word "beta-rad" is encountered, I try to replace that with an actual greek beta symbol. I am using this in my xsl file:
<xsl:when test="$property_string = 'beta-rad'">
(β<sub>rad</sub>)
...
On Windows XP, using Internet Explorer 6, I get the desired result. Under Windows 2000, using IE 6, I get this:
[ (qbar) (Sw) (bw) (αrad) (rudder-pos-rad) (table) ]
Does anyone know why it's a different result on the two machines?
Jon
When the word "beta-rad" is encountered, I try to replace that with an actual greek beta symbol. I am using this in my xsl file:
<xsl:when test="$property_string = 'beta-rad'">
(β<sub>rad</sub>)
...
On Windows XP, using Internet Explorer 6, I get the desired result. Under Windows 2000, using IE 6, I get this:
[ (qbar) (Sw) (bw) (αrad) (rudder-pos-rad) (table) ]
Does anyone know why it's a different result on the two machines?
Jon
Jon Berndt
Development Coordinator
JSBSim Project
Open Source Flight Dynamics Model
http://www.jsbsim.org
Development Coordinator
JSBSim Project
Open Source Flight Dynamics Model
http://www.jsbsim.org
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Hi Jon,
It is not a different result, it is a difference in how that result is rendered. The output that you get is in both cases encoded in UTF-8 and in the first case the browser renders that as UTF-8 and you see the correct result and in the second case the browser uses some other encoding and you see a different result. Try setting the encoding in the second case to UTF-8 and you should see the beta character.
Also if you generate the charset in the output HTML then the browser should know what encoding to use, for instance the following stylesheet applied on any XML file generates the output below that contains the charset specified as UTF-8:
Best Regards,
George
It is not a different result, it is a difference in how that result is rendered. The output that you get is in both cases encoded in UTF-8 and in the first case the browser renders that as UTF-8 and you see the correct result and in the second case the browser uses some other encoding and you see a different result. Try setting the encoding in the second case to UTF-8 and you should see the beta character.
Also if you generate the charset in the output HTML then the browser should know what encoding to use, for instance the following stylesheet applied on any XML file generates the output below that contains the charset specified as UTF-8:
Code: Select all
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" encoding="UTF-8"/>
<xsl:template match="/">
<html>
<head></head>
<body>
(β<sub>rad</sub>)
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Code: Select all
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
(β<sub>rad</sub>)
</body>
</html>
George
-
- Posts: 20
- Joined: Sat Nov 26, 2005 5:17 pm
- Location: Houston, Texas, USA
- Contact:
Hi, George,george wrote:Hi Jon,
It is not a different result, it is a difference in how that result is rendered. The output that you get is in both cases encoded in UTF-8 and in the first case the browser renders that as UTF-8 and you see the correct result and in the second case the browser uses some other encoding and you see a different result. Try setting the encoding in the second case to UTF-8 and you should see the beta character.
...
Best Regards,
George
Thanks for the help - that fixed it, of course.
Best regards,
Jon
Jon Berndt
Development Coordinator
JSBSim Project
Open Source Flight Dynamics Model
http://www.jsbsim.org
Development Coordinator
JSBSim Project
Open Source Flight Dynamics Model
http://www.jsbsim.org
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service