a discussion how whitespace should be treated came up on the apps-
discuss list [*].
Short summary:
Whitespace matters in all of Metalink's XML elements, and MUST not be
ignored; it's part of their content. This also implies a caveat for
generators to make sure that some XML library that's used doesn't add
whitespace around values by default. (The exmples in the Internet
Draft need to be fixed to match this. This affects date fields and
IRIs (URLs).)
However, a more relaxed scheme that would strip trailing and leading
whitespace has been suggested:
http://www.ietf.org/mail-archive/web/apps-discuss/current/msg01189.html
I'm pondering on this, and would love to hear some opinions...
Peter
> On 12月14日, 午後2:49, Anthony Bryan <anthonybr...@gmail.com>
> wrote:
>> here's the current text, suggested by Julian Reschke:
>>
>> All leading and trailing whitespace is part of the element content,
>> and MUST NOT be ignored. Consequently, it is disallowed for elements
>> where the defined type does not allow whitespace, such as dates,
>> integers, or IRIs. Some XML-generating implementations erroneously
>> insert white space around values by default, and such implementations
>> will generate invalid Metalink Documents.
>>
>
> I think this text is clear and looks good.
> BTW how should the client behave when such invalid Metalink documents
> are given?
> In aria2, I currently strip left and right white spaces for all values
> in Metalink document version 3.0.
> If URI has trailing white space, then it is 404 error.
> For new IETF version, should the client not remove white spaces for
> URI?
I think I would do exactly that.
I just would not strip whitespace from the fields that contain text
(description/license) or signatures.
Peter
Thanks for the comments! I now see that the currently specified way of
dealing with whitespace is fine.
> It would be pretty cool with a validation web site for metalinks, by
> the
> way. Something similar to http://validator.w3.org/. Anyone
> interested in
> creating something like that? I'll be interested in doing it, but I'd
> prefer to finish Metalink Editor 2.0 first (it is slowly making
> progress).
Ah, yes, that would be quite cool indeed!
Peter