bkriekaard
22nd August 2014, 14:13
Information:
The term CDATA is used about text data that should not be parsed by the XML parser.
Some text, like JavaScript code, contains a lot of "<" or "&" characters. To avoid errors script code can be defined as CDATA.
Everything inside a CDATA section is ignored by the parser.
A CDATA section starts with "<![CDATA[" and ends with "]]>":

My problem:
I can't find the right function to make the CDATA section.
When I put it as plain text in the export script the < is translated to &gt;

<W_DRIVE>&lt;![CDATA[W_DRIVE-Quartz]]&gt;</W_DRIVE>

it should be

<W_DRIVE><![CDATA[W_DRIVE-Quartz]]></W_DRIVE>

for example how I create the line now:
xmlNewDataElement("name", "<![CDATA[" & trim$(tcibd001.wdsc.c) & "]]>" , l.xml.product.language)

Who can help me with the right function(s) to correct this ?

Thanks Bennie

bhushanchanda
22nd August 2014, 14:41
Hi,

You can follow this Thread (http://www.baanboard.com/baanboard/showthread.php?t=42836)

bkriekaard
22nd August 2014, 17:45
Hello,
I've tried to implement the example from the other post, but still no good result:

l.fd = seq.open(bestandsnaam_tijd, "w")
if l.fd > 0 then
xmlWritePrettytostring(xmlstr,l.xml.products)
xmlstr = xmlstr(1;pos(xmlstr,"&lt;")-1) & "<" & xmlstr(pos(xmlstr,"&lt;")
+4;pos(xmlstr,"&gt;")-pos(xmlstr,"&lt;")-4)
& ">" & xmlstr(pos(xmlstr,"&gt;")+4)

l.ret = seq.puts(xmlstr, l.fd)
seq.close(l.fd)