baanware
12th October 2012, 11:35
Hi

I have been using the XML functions for a long period - basically they work fine. There is one important facility which is missing though, which makes the facilities almost un-useable: the ability to use other encodings other that UTF-8.

I have an on-line interface running between LN and a .net application. All information is exchanged in XML-strings. The solution is a global solution, and we need to exchange data in 25+ different languages.
.net only works in UNICODE mode whereas the standard LN XML parser / generator works in UTF-8 mode (even though the database behind LN works in UNICODE). Every time we have information containing country/language-specific characters, we have serious problems.

I have seen several threads on similar issues, but no solutions. My question is therefore: Has anybody any experiences in accessing an external parser/generator from the inside of LN (Tools Development)?
Has anybody successfully been able to replace or extend the standard XML tools from Infor?

Thanks!

BaanInOhio
12th October 2012, 17:09
I wrote a DLL with a function to handle the writes to the XML stream using standard functionality. This reduces the amount of retyping/cut-and-paste for the often lengthy XML calls. Another function was written to "clean and create XML file" to:


Writes the XML stream to a temporary file (pretty)
Opens another file to accept the new lines
Add additional headings/specification statements, often replacing the one that Baan/LN created.
Read each line from the temporary file to a buffer then alter the contents to reduce unnecessary tab characters from the standard XML functionality (combine buffers before writing by looking for termination substring = "</"), and replace characters like a space to " " in the file.


I remove the extra tab characters to compact the size of the XML file and make it more readable (looking more standard) in editors and browsers.

Other changes can be applied to support UNICODE in the same manner.

baanware
14th October 2012, 11:21
Hi BaanInOhio

Thanks for your reply.

I do not completely understand how this should change the XML string in UNICODE format. When the standard LN (or Baan) XML generator generates a file it always converts the data into UTF-8 as far (as I know). How do you make this back into UNICODE? Do you use a conversion tool like for example “iconv”? Surely it is not enough to change the encoding declaration in the “header”.

By the way I would prefer to handle everything in storage (currently I use xmlWriteToString). The code I use is a part of an on-line interface connected to a WEB application. Our exchange of data is made in a single in-memory XML-string.
Each click the user makes can cause several calls to LN. As WEB users do not tolerate long waiting times, my objective is to keep my the simple calls at response times < 20-25ms. I expect that writing to several files in sequence will make it difficult for me to obtain the performance required.

My code is actually running live, and it works beautifully for US and GB customers, but as soon as we enter areas of the world with specific codepage requirements, we run into problems, where special characters are “mistreated” in the “.net/web” end. That’s why I would like to replace the standard XML generator/parser with a facilities with more extended encoding facilities.

On the XML generator side I am currently considering to continue building up the XML structure using the standard functions in LN and then write my own "xmlWriteToString" call. On the parser side I could probably do something similar. (?)
...unless you or somebody else can show me a better way. ;)