[fpc-pascal] XML - Indent, text content, special char

Gabor Boros mlnglsts at bgss.hu
Mon Apr 29 19:27:19 CEST 2019


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
-------------- next part --------------
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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: TEST.xml
Type: text/xml
Size: 98 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20190429/bf36dc1a/attachment.xml>


More information about the fpc-pascal mailing list