|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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? |
|
#2
|
||||
|
||||
|
Try looking at the <xsl: output> tag (in example 1 for example):
http://www.w3schools.com/xsl/el_output.asp ![]() |
|
#3
|
|||
|
|||
|
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 <xsl
utput 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 <xsl utput 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. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > Encoding issue |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|