[fpc-pascal] XMLWrite looses data

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Mar 24 14:58:21 CET 2014


On Sun, 23 Mar 2014 17:58:16 +0000
Graeme Geldenhuys <mailinglists at geldenhuys.co.uk> wrote:

> Hi,
> 
> I'm loading up a XSL file into a TXMLDocument using XMLRead. Up to this
> point everything seems to be ok, and I can query the DOMNodes without
> problem. If I then save that file out again, using XMLWrite, I noticed
> that some data is lost. :-/
> 
> I don't know if this is because the file is a XSL file? Though I thought
> XSL is exactly the same structure as XML - so didn't expect any problems.

Yes, XSL is XML.

> [...]
> Note the two '&#xa0;' escaped characters are lost near the end in the
> newly written file.

The parser converts &#*; to Unicode characters when
reading. AFAIR some xsl parsers like xsltproc do the same.
If you want xslt to output '&#xa0;' you can use '&#xa0;'


Mattias



More information about the fpc-pascal mailing list