//>Descriptions
CLEAR(LongDescr);
CR[1] := 13;
LF[1] := 10;
Item.CALCFIELDS(WebTextDK);
Item.WebTextDK.CREATEINSTREAM(Istream);
LongDescr.READ(Istream);
CLEAR(LongDescription);
IF LongDescr.LENGTH > 0 THEN BEGIN
LongDescription.ADDTEXT('<![CDATA['+CR+LF);
LongDescription.ADDTEXT(LongDescr);
LongDescription.ADDTEXT(CR+LF+']]>');
END;
And it gives med this :
<LongDescription><![CDATA[
Æske m. låg i sæt af 3 Bruges til dekoration eller som opbevaring af kontorartikler eller mindre legetøj og nips
]]></LongDescription>
I can see the this site convert the character I tried to write back to <>
<LongDescription><![CDATA[
Æske m. låg i sæt af 3 Bruges til dekoration eller som opbevaring af kontorartikler eller mindre legetøj og nips
]]></LongDescription>
First I export the XML file with <LongDescription> as a normal text. (BIGTEXT)
Then when file is closed I use this code :
Xml := Xml.XmlDocument();
Xml.Load('C:\TEMP\Products.xml');
XMLRootNode := Xml.DocumentElement;
FOREACH XmlNode IN XMLRootNode.SelectNodes('/root/Products/Product/LongDescription') DO
BEGIN
innertext := XmlNode.InnerText;
IF innertext <> '' THEN BEGIN
newCDATA := XmlNode.OwnerDocument.CreateCDataSection(innertext);
XmlNode.InnerText := '';
XmlNode.AppendChild(newCDATA);
END;
END;
Variables defined :
Xml DotNet System.Xml.XmlDocument.'System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
XmlNode DotNet System.Xml.XmlNode.'System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
XMLRootNode DotNet System.Xml.XmlNode.'System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
innertext Text
newCDATA DotNet System.Xml.XmlCDataSection.'System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
Answers
That's the one I have used
And it gives med this :
<LongDescription><![CDATA[
Æske m. låg i sæt af 3 Bruges til dekoration eller som opbevaring af kontorartikler eller mindre legetøj og nips
]]></LongDescription>
With the <! and >
The XMLPORT that replaces the <>
I can see the this site convert the character I tried to write back to <>
I have solved it with a little dotnet.
First I export the XML file with <LongDescription> as a normal text. (BIGTEXT)
Then when file is closed I use this code :
Variables defined :
Xml DotNet System.Xml.XmlDocument.'System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
XmlNode DotNet System.Xml.XmlNode.'System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
XMLRootNode DotNet System.Xml.XmlNode.'System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
innertext Text
newCDATA DotNet System.Xml.XmlCDataSection.'System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
My solution,
I anyone runs into same issue.
Thanks.