Jump to content

import xml data


magnusk

This topic is 6408 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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)

Link to comment
Share on other sites

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


(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 by Guest
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 6408 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.