[fpc-devel] XML Components

Sergei Gorelkin sergei_gorelkin at mail.ru
Fri Nov 2 18:19:45 CET 2012


02.11.2012 21:06, Jeppe Græsdal Johansen пишет:
> Den 02-11-2012 18:04, Michael Van Canneyt skrev:
>>
>>
>> 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.
> Yes, but changing the version still generates the same error, even though it shouldn't
>> 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.
> It's true that it's not a good idea, but it should work at least :)

To my knowledge, XML 1.1 supports codes below 32 only in escaped forms. "" is valid in XML 1.1 
but not in XML 1.0.

Regards,
Sergei






More information about the fpc-devel mailing list