XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 24th, 2004, 11:52 AM
IvanE IvanE is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 98 IvanE User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 19 m 38 sec
Reputation Power: 5
Encoding issue

I am having a slight issue here with encoding. Any help will be welcome. I basically have htm files that are being converted to xsl. One issue is the encoding. Its not causing any problems but here is what I have in my htm file;

<html>
<head>
<meta id="charset_select" http-equiv="Content-Type" content="text/html; charset=iso8859-1">
<link rel="stylesheet" type="text/css" href="cfgwizstyle.css">
</head>

In my xml I have this;

<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="CA_Select.xsl"?>

And in my xsl, I have this;

<?xml version="1.0" encoding="iso8859-1" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="LocalisedData/file[@ID='CA_Select.htm']">
<html>
<head>
<link rel="stylesheet" type="text/css" href="cfgwizstyle.css"/>
</head>

Okay, so I am just showing the first few lines of each file so disregard the non closing of tags etc. But my output xhtml is this;

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF8">
<link rel="stylesheet" type="text/css" href="cfgwizstyle.css">
</head>


I am getting 'charset=UTF8' even though I haven't set that. I want 'charset=iso8859-1' like the original htm.

I don't know much about the encoding in xsl and xml and am unfortunately not getting to grips with what I have read so far. Anyone know what's happening with this and does it matter?

Reply With Quote
  #2  
Old August 25th, 2004, 07:46 AM
Miska's Avatar
Miska Miska is offline
Madden Maniac
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2001
Location: Finland
Posts: 519 Miska User rank is Lance Corporal (50 - 100 Reputation Level)Miska User rank is Lance Corporal (50 - 100 Reputation Level)Miska User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Day 3 h 47 m 50 sec
Reputation Power: 8
Try looking at the <xsl: output> tag (in example 1 for example):

http://www.w3schools.com/xsl/el_output.asp

Reply With Quote
  #3  
Old August 25th, 2004, 09:49 AM
IvanE IvanE is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 98 IvanE User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 19 m 38 sec
Reputation Power: 5
Thanks Miska. But I found out what was the problem. Unfortunately I was just really using an example that they had already done here without cleaning it up properly first. In most of my xsl I had used the <xslutput encoding> but what I found was that is I just used the line below

<?xml version="1.0" encoding="iso8859-1" ?>

it would still output utf 8. If I used this line as well

<xslutput encoding="iso8859-1" indent="yes"/>

it worked fine. But if I used the line above on its own it worked fine also so that's what I did. There was also an encoding line in the html that was putting me off as I was trying just to just output that rather than any encoding in the xsl.

In the html I had something like this,

<meta id="charset_postinstall" http-equiv="Content-Type" content="text/html; charset=iso8859-1" />

So I had to take that out from within the <html> tag in the xsl, set the xsl:encoding to be that of iso8859-1. The only thing I couldn't do was to get the 'id' value into the encoding.

The html code already exists so I don't know what the id tag is used for but it seems to me that it isn't important.

Thanks again for your input Miska, you were pointing in the right direction.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Encoding issue


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT