magnusk Posted October 31, 2006 Posted October 31, 2006 I am trying to import xml-data coming to me in ISO-8859-1 format. I have problem importing files when: - content of a field include i.e. "&". Can not open the file at all - content of fields include Swedish characters "å, ä ,ö". Can open but don't import the characters correct. A file can look like: <?xml version='1.0' encoding='ISO-8859-1'?> 2006-10-26 10:41:46 vartannat lysrör lyser i skärmtaket 1491060 BELYSNINGSSYSTEM (EX, UNDER SKÃRMTAK; ANNAN SS BELYSNING)
Fenton Posted October 31, 2006 Posted October 31, 2006 (edited) I'm assuming you have an xsl stylesheet that is working, other than the above problem? Try adding the disable-output-escaping="yes" attribute to your element selection. Example (you'd do it differently; but this is the idea) (P.S. When you post XML code here, esp. if it has characters you don't want messed up, it's best to surround it with bracketed "code, /code" tags (can't type 'em here). Edited October 31, 2006 by Guest
magnusk Posted October 31, 2006 Author Posted October 31, 2006 I have already tried without success so I guess that I don't get it right. I attach files. If you should have time to look I would be very glad! 0000369475.txt import.txt
Martin Brändle Posted October 31, 2006 Posted October 31, 2006 The encoding of your XML is not ISO-8859-1, but UTF-8. You see that when you click the 0000369475.txt link and then change the encoding of your browser (Firefox: View > Text Encoding) to UTF-8. Then the Swedish characters are displayed correctly. It's also clear from looking at the wrongly encoded file, because two bytes were needed per Swedisch umlaut character. Just replace ISO-8859-1 by UTF-8 in the XML heading line of 0000369475.txt and in import.xsl. Also add a immediately after your tag.
magnusk Posted November 2, 2006 Author Posted November 2, 2006 I have tried adding in import-stylesheet with no success. The XML-file come to me. I can not make changes and the company sending them don't want to either. Maybe I changed the encoding saving the xml-file as text? Trying to open the original xml-file in Firefox UTF-8 is chosen, I can not change, but the characters are shown badly.
Martin Brändle Posted November 2, 2006 Posted November 2, 2006 Tell the company they shall set it as UTF-8. This is definitely not ISO-8859-1.
Recommended Posts
This topic is 6594 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now