prademaker
28th March 2006, 22:35
Have a problem when reading XML files using the Baan function XMLRead.
(Baan IVc on unix).

The problem is in using special charactes like ï or ä or °. Whenever such a character is in the data, i get thrown out of baan with a bw-message "system is running low on memory".

I'm using:
<?xml version="1.0" encoding="ISO-8859-1"?>
in my xml file. According to the program manual ISO-8859 should be supported.

Changing it to UTF-8 did not change much, now i get an "error converting to local" but i'm not thrown out of Baan.

Anyone any idea?

vahdani
29th March 2006, 17:51
Hi peter,

can you please attach a typical test xml file which you have problem reading. I could try to read it and see what happen here!

prademaker
30th March 2006, 09:53
Hi Vahdani,


i would appriciate it if you would try to read the attached xml-file.

In this file the problem is in following line:

<a><n>ErpDisplayName</n><v>DS A 48 STAPELBAKKEN N° 4.ROOD</v></a>

When i change the "°" in "r" there's no problem.

I get the problem as soon as i try to execute xmlRead( ...)

Playing with the encoding in the xml-file gives a different result:

<?xml version="1.0" encoding="ISO-8859-1"?>

Kicks me out of baan with following message:

BW Message: 1: process 58 - Error : WARNING: Running low on memory
2: Connection with server lost

<?xml version="1.0" encoding="UTF-8"?>

Baan keeps on running, the function returns an error message: "Conversion to LOCAL failed"

<?xml version="1.0" encoding="UTF-16"?>

Again Baan keeps on running, but an error message: "Line: 1;Col: 30; encoding specified in XML declaration is incorrect"
If you would manage to open it without pain, there must be something wrong in our environement.

Just for you info we're running Baan IVc SP15.

Your feedback will help me to identify wheather the problem is in Baan or in the setup of our system.

Thanks four your help

vahdani
30th March 2006, 17:39
Hi Peter,

I tried reading in your file in Baan IV and LN with no luck in both cases. In Baan IV environment this resulted in a major core dump! One could safely say that the Praser has a bug when it comes to ISO-8859-1 encoding and special charachters. I converted the File to Unicode using the conversion functionality in UltraEdit (see attached file) and was able to read this in without any problems. You can check the encoding by using a HEX-Editor. First there are the starting bytes FFFE and then the two byte code per character.

For the fun of it I exported the xml-Document (see attached script) this schould have generated UTF8 encoded ouput. The generated output seem to me also to be encoded in UTF16(Unicode) and not UTF8.

The moral of the story: Convert your XML files to Unicode before import!

prademaker
31st March 2006, 08:35
Thanks for your efforts! At least now it's clear where the problem lies. As it seems to be in the apllication itself it's time to find a work-around.

I also tried to convert the file. I did it using the unixcommand iconv. Tried converting it to UTF-8, processing went OK, but the special characters didn't show up like expected in Baan. Converting it to UTF-16 did the trick.

Once again this forum proves it's outstanding value!

Regards,

Peter:

Francesco
20th July 2007, 17:02
Maybe a little late in the game, but I am doing some XML wrestling and I found that Excel2000 is also unable to parse past é, É and the likes.

What's up with that?