[fpc-devel] XML Components

Michael Van Canneyt michael at freepascal.org
Fri Nov 2 13:24:51 CET 2012



On Thu, 1 Nov 2012, Andrew Brunner wrote:

> I'm having a problem getting the XML parser to read.
>
> Is there any way I can get the attached program to work by changing a parsing 
> option to one less strict.  My XML documents get over 1-2 GBs since they 
> represent files.  So having to convert /scan each byte is unacceptable.

I suggest you revert to something else than XML, if that's an option.
XML is notoriously slow to load.

>
> Is there another XML parser component that can establish a DOM?  Or is this a 
> bug in the fpc XML component?

This is not a bug, it is prescribed behaviour.

The XML components must work on any XML document that exists out there.
As a consequence, the codepage in the XML must be checked and converted if need be.

Imagine you have a XML file encoded in UTF16, and we assume it's UTF-8. 
The resulting DOM tree would be unusable.

> Any help or feedback is entirely welcome and needed.  This data in currently 
> in at least 1 stream and failing my cloud desktop sync application.

You'll have to write your own XML handling routines which work only with 
the codepage the XML is in. And be prepared that they will fail as soon 
as the encoding of the XML changes.

>
> I would really love an option to disable XML byte for byte checking during 
> parsing.

That's not likely to happen.

Michael.



More information about the fpc-devel mailing list