xmllib.apl text node reads no CRLF

Discussion forum about all things Team Developer 5.x and 6.x
EwaldP
Austria
Posts: 117
Joined: 07 Mar 2017, 08:00
Location: Austria

xmllib.apl text node reads no CRLF

Post by EwaldP » 03 Oct 2018, 13:33

Hi guys,

maybe I'm wrong but I think that this should work.

1. export text containing CRLF from database to a xml file - works ok

2018-10-03 15_18_23-_C__HLENT_TD 6.3_WAWI_zeit01.xml - Notepad++ [Administrator].png

2. after import the xml file the CRLF in the data field REPORT_BEZ are gone. Both functions lv_uNode.nodeValue and lv_uNode.getTextContent reveive the string without CRLF

2018-10-03 15_24_15-OpenText Gupta Team Developer 6.3 - wawi_setup.apl - [wawi_setup.apl].png


Any hints?
You do not have the required permissions to view the files attached to this post.
Ewald P. Palmetshofer
EDV-Hausleitner GmbH
4020 Linz
www.edv-hausleitner.at

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 1137
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: xmllib.apl text node reads no CRLF

Post by Dave Rabelink » 03 Oct 2018, 14:30

Shouldn't a CRLF be escaped in the XML?

Code: Select all

New Line XML
    Carriage return: 
    Line feed: 

Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

EwaldP
Austria
Posts: 117
Joined: 07 Mar 2017, 08:00
Location: Austria

Re: xmllib.apl text node reads no CRLF

Post by EwaldP » 04 Oct 2018, 06:32

Hi Dave,

in the XML should be a CRLF and it is. When re-parsing the xml-file, node.nodeValue( ) and node.getTextContent provides the string without CRLF - that's strange for me.
Ewald P. Palmetshofer
EDV-Hausleitner GmbH
4020 Linz
www.edv-hausleitner.at

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 1137
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: xmllib.apl text node reads no CRLF

Post by Dave Rabelink » 04 Oct 2018, 07:12

What is the source of the XML?
Is it created using XML parser or is it manually constructed?

To my knowledge, CRLF should always be escaped in XML to ensure that every parser is working like expected.
Depending on the parser it may treat CRLF differently.
(as you see in your sample)

https://www.w3.org/TR/REC-xml/#sec-line-ends
http://sbndev.astro.umd.edu/wiki/Some_T ... Characters
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

EwaldP
Austria
Posts: 117
Joined: 07 Mar 2017, 08:00
Location: Austria

Re: xmllib.apl text node reads no CRLF

Post by EwaldP » 04 Oct 2018, 11:56

oh, I understand. The idea was to have a data export program that exports the data from multiple database tables in a xml-file. With a data import program I want to import the data from the xml file in the table in another database. In some columns there are text informations with CRLF and these CRLF are gone.
Ewald P. Palmetshofer
EDV-Hausleitner GmbH
4020 Linz
www.edv-hausleitner.at

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests