2019. 04. 28. 9:25 keltezéssel, Gabor Boros írta:
The "indent" and "text content" problems solved on the reader side by ReadXMLFilePreserveWhitespace:


With a sample application but not with the real life application. :-(
(My real application just find node for every second FindNode call.)

With the attached example and test xml file I got the next result:

*a*
**

Is this not a bug? Lost of formatting is not disturb me but text between > and < is the data/text content of a node.

Gabor
program XML_Read;

uses DOM,XMLRead;

var
  X:TXMLDocument;

begin
  ReadXMLFile(X,'TEST.xml');
  WriteLn('*',X.FindNode('doc').FindNode('text1').TextContent,'*');
  WriteLn('*',X.FindNode('doc').FindNode('text2').TextContent,'*');
end.

<?xml version="1.0" encoding="utf-8"?>
<doc>
  <text1>    a</text1>
  <text2>     </text2>
</doc>
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to