[fpc-devel] XML Components

Michael Van Canneyt michael at freepascal.org
Fri Nov 2 18:04:29 CET 2012



On Fri, 2 Nov 2012, Jeppe Græsdal Johansen wrote:

>> and LF, to appear in data, both in literal and escaped forms.
>> In other words, XML is wrong technology to work with binary data, unless it 
>> is encoded into textual form (Base64 or alike).
>> 
>> Regards,
>> Sergei
>> _______________________________________________
>> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
>> http://lists.freepascal.org/mailman/listinfo/fpc-devel
> XML 1.1 allows anything down to #1, but the current parser doesn't seem to 
> allow that. I guess that should solve most of the problems here.
>
> Specifically, TXMLDecodingSource.SkipUntil doesn't allow #1..#31 if 
> FXML11Rules is true, which I think it should.

But the document prolog specified XML version 1.0,
so these characters are not allowed.

If of course Andrew creates the XML himself, he can specify 
1.1 as the XML version, then that may well be a solution.

Note that the specs of 1.1 still say that

"The characters defined in the following ranges are also discouraged. 
They are either control characters or permanently undefined Unicode characters:

[#x1-#x8], [#xB-#xC], [#xE-#x1F], [#x7F-#x84], [#x86-#x9F], [#xFDD0-#xFDDF],
[#x1FFFE-#x1FFFF], [#x2FFFE-#x2FFFF], [#x3FFFE-#x3FFFF],
[#x4FFFE-#x4FFFF], [#x5FFFE-#x5FFFF], [#x6FFFE-#x6FFFF],
[#x7FFFE-#x7FFFF], [#x8FFFE-#x8FFFF], [#x9FFFE-#x9FFFF],
[#xAFFFE-#xAFFFF], [#xBFFFE-#xBFFFF], [#xCFFFE-#xCFFFF],
[#xDFFFE-#xDFFFF], [#xEFFFE-#xEFFFF], [#xFFFFE-#xFFFFF],
[#x10FFFE-#x10FFFF]."

So it would be wise to replace the characters with encoded data.

Michael.


More information about the fpc-devel mailing list