Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
37%
Installation Wizard into new VRC
39%
Manual into existing VRC
3%
Manual into new VRC
21%
Total votes: 38

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 21st February 2011, 17:06
baanware baanware is offline
Junior Member
 
Join Date: Feb 2002
Location: Denmark
Posts: 25
baanware is on a distinguished road
Baan: BaanIV, BaanV - DB: any - OS: any
XML problem parsing multi-line field/node
Baan: ERP LN 6.1 FP6
C/S: Server

Hi,

Using the standard XML parser I have been trying to read a multi-line field (which in the XML file contains line feeds: x'0D + x'0A).

I have tried to read the node using xmlgetdataelement as well as xmlgetdata but both functions removes all CR+LF's and presents the multi-line text as one (very long) field.

I tried to save the XML-file in UNIX format - the result was the same :-(

Can anybody tell me: How do I read such a multi-line field?

When I debug and display of the node (using "Show XML tree"), the individual lines are perfectly displayed. (?)

Thanks!

Last edited by baanware : 23rd February 2011 at 23:28. Reason: attachment problems
Reply With Quote
  #2  
Old 25th November 2011, 11:18
chijoe chijoe is offline
Junior Member
 
Join Date: Jun 2008
Posts: 3
chijoe is on a distinguished road
Baan: LN - DB: Oracle - OS: Unix,Windows
problem solved

Hi,

I just wanted to ask if you solved this problem because I have actually the same problem/situation and can find any solution. Would be great to hear from you!


Thanks

Sven
Reply With Quote
Sponsored Links
  #3  
Old 28th November 2011, 08:36
pconde pconde is offline
Senior Member
 
Join Date: May 2002
Location: Belgium
Posts: 162
pconde is on a distinguished road
Baan: BaanIVc4, BaanERP 5.0, ERP LN6.1 - DB: Oracle, informix, DB400 - OS: unix, As400, windows 2003
Hello,

i think that this could be done via the parameter whitespacehandling in the xmlread instuction:
long xmlRead(long fp, ref string error, [ long whitespacehandling ] )

whitespacehandling = xmlPreserveWhiteSpace. Look also in the help of xmlRead for more information.

Regards
Philippe
Reply With Quote
  #4  
Old 28th November 2011, 11:04
baanware baanware is offline
Junior Member
 
Join Date: Feb 2002
Location: Denmark
Posts: 25
baanware is on a distinguished road
Baan: BaanIV, BaanV - DB: any - OS: any
Hi All,

Yes I did get around the problem, but unfortunately not the most elegant way.

First I discovered that if the multiline text was surrounded by a "[CDATA[" tag it is treated as "Unparsed Character Data". The XML element would in other words have the following structure:
<nodename>"[CDATA[...multi-line text...]]</nodename>

Having done so the file was at least parsed without errors, but unfortunately the line feeds in the text were turned into spaces, and I needed well defined line breaks in the texts.

Therefore I decided to change all the line feeds into a dummy character sequence: "$$".

Having parsed the file and read the node, I now run the contents through a tiny procedure, which converts "$$" into a line feed.

Not elegant :-( ...but it works
Reply With Quote
  #5  
Old 29th November 2011, 09:26
chijoe chijoe is offline
Junior Member
 
Join Date: Jun 2008
Posts: 3
chijoe is on a distinguished road
Baan: LN - DB: Oracle - OS: Unix,Windows
Hi,

thanks for the answers. Unfortunately my problem is the same but not exactly. Because I don't have a xml file which I read and load into the memory. I'm getting SOAP Responses directly into Baan via the Baan SOAP Client. So the Response is a XML Structure which goes directly into the memory.

SO I proberly don't have any other choice than contact the Baan Support!

Thanks

Sven
Reply With Quote
  #6  
Old 29th November 2011, 10:47
baanware baanware is offline
Junior Member
 
Join Date: Feb 2002
Location: Denmark
Posts: 25
baanware is on a distinguished road
Baan: BaanIV, BaanV - DB: any - OS: any
In case you have it in memory it should be even more simple. You just have to search the input string for CRLF and exchange the characters with your line "feed dummy characters" ($$ in my example). Afterwards the input string is ready for the LN XML parser

But if you could manage to make Infor Support fix the problem in a general way, it would be usefull to all of us - and a far better long term solution.

Best regards
Sören L
Reply With Quote
  #7  
Old 30th November 2011, 09:07
chijoe chijoe is offline
Junior Member
 
Join Date: Jun 2008
Posts: 3
chijoe is on a distinguished road
Baan: LN - DB: Oracle - OS: Unix,Windows
Hi,

I've already tried that.But when I write the multiline content into a string Variable all CRLF are already cutted out. But all these function with write the content of a Node to a String do that. Or do you might know some function which I don't know? :-)

----------
string t.str(1) mb based
alloc.mem(t.str, 500000)
long t.file
long i
long ascii
string t.s(1)

t.xml.node = xmlFindFirst("Response", i.xml.response)
| t.str = xmlData$(t.xml.node)
| xmlAllocPrettyString(t.str, t.xml.node)
xmlWritePrettyToString(t.str, t.xml.node)



for i=1 to 5000
t.s = t.str(i;1)
ascii = asc(t.str(i;1))
endfor
----------


Thanks Sven
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in script to check on PO line status mattan Tools Development 6 5th August 2004 15:31
Problem inserting line in tdsls041 gentercz AFS/DDC/OLE: Function servers 12 29th January 2004 17:27
Line per inch problem draeger Tools Development 0 11th June 2003 16:37
Integration Entry problem. amarpreet Distribution, Transportation & Warehousing 3 12th December 2002 06:28
Problem: increment of purchase receipt line tbrault Distribution, Transportation & Warehousing 5 3rd July 2002 10:20


All times are GMT +2. The time now is 10:30.


©2001-2017 - Baanboard.com - Baanforums.com