Whitespace in Metalinks

0 views
Skip to first unread message

Peter Pöml

unread,
Dec 13, 2009, 9:30:14 PM12/13/09
to metalink-...@googlegroups.com
Hi,

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

[*] https://www.ietf.org/mailman/listinfo/apps-discuss

Nicolas Alvarez

unread,
Dec 13, 2009, 10:39:29 PM12/13/09
to metalink-...@googlegroups.com
My suggestion:
* whitespace inside an element that has to have text (for example <url>) is
significant. The whitespace would be considered part of the URL.
* whitespace *between* that kind of elements (like after a </url> and
before the next <url>, or before </resources>) is not significant.

--
Nicolas

I read mailing lists through Gmane. Please don't Cc me on replies; it makes
me get one message on my newsreader and another on email.

Anthony Bryan

unread,
Dec 14, 2009, 12:49:31 AM12/14/09
to metalink-...@googlegroups.com
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.
--
(( Anthony Bryan ... Metalink [ http://www.metalinker.org ]
)) Easier, More Reliable, Self Healing Downloads

Tatsuhiro

unread,
Dec 14, 2009, 7:26:29 AM12/14/09
to Metalink Discussion
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?

Hampus Wessman

unread,
Dec 14, 2009, 12:44:43 PM12/14/09
to metalink-...@googlegroups.com
On 2009-12-14 13:26, Tatsuhiro wrote:
> 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 also think this is good and clear. Metalink Editor also currently
strips whitespace. With this in the standard most generators will
hopefully start generating metalinks with no extra whitespace inside
elements.

Perhaps it is simply best not to give any recommendation on how to deal
with invalid metalinks (they are invalid, after all). Most
implementations will probably accept some invalid metalinks anyway (e.g.
by stripping leading and trailing whitespace).

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).

Peter Pöml

unread,
Dec 14, 2009, 8:35:16 PM12/14/09
to metalink-...@googlegroups.com

Am 14.12.2009 um 13:26 schrieb Tatsuhiro:

> 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

Peter Pöml

unread,
Dec 14, 2009, 8:43:00 PM12/14/09
to metalink-...@googlegroups.com

Am 14.12.2009 um 18:44 schrieb Hampus Wessman:
> I also think this is good and clear. Metalink Editor also currently
> strips whitespace. With this in the standard most generators will
> hopefully start generating metalinks with no extra whitespace inside
> elements.
>
> Perhaps it is simply best not to give any recommendation on how to
> deal
> with invalid metalinks (they are invalid, after all). Most
> implementations will probably accept some invalid metalinks anyway
> (e.g.
> by stripping leading and trailing whitespace).

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

Tatsuhiro Tsujikawa

unread,
Dec 15, 2009, 9:47:08 AM12/15/09
to metalink-...@googlegroups.com
Hi

Peter P�ml wrote:
>
> Am 14.12.2009 um 18:44 schrieb Hampus Wessman:
>> I also think this is good and clear. Metalink Editor also currently
>> strips whitespace. With this in the standard most generators will
>> hopefully start generating metalinks with no extra whitespace inside
>> elements.
>>
>> Perhaps it is simply best not to give any recommendation on how to deal
>> with invalid metalinks (they are invalid, after all). Most
>> implementations will probably accept some invalid metalinks anyway (e.g.
>> by stripping leading and trailing whitespace).
>
> Thanks for the comments! I now see that the currently specified way of
> dealing with whitespace is fine.
>

I'm also prefer to just use the text as is, because it is more
efficient(ultimately it uses less CPU cycles, so it's eco friendly;) ).
Though it is more strict than Metalink v3, but we learned from the
history of HTML;). By rejecting invalid documents, I hope it will
eliminate bad implementation of generator.

>> 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!
>

It would be good to create it in google apps engine, isn't it?
I'm very much interested in GAE recently.

Best regards,

Tatsuhiro Tsujikawa

Bram Neijt

unread,
Dec 15, 2009, 5:09:24 PM12/15/09
to metalink-...@googlegroups.com
Hi,

I'd be happy to create it. I've already written dynmirror.net in the
google app engine, and I'd be happy to set up another app or create a
page at my virtual server (logfish.net).

Recently I finished my master thesis (last week), so I'm also free to
poor some time in this. I'd be happy to do it.

Any comments are welcome, but if nobody has more to say then I will open
a Google app-engine and start coding. I'd be happy to add Tatsuhiro and
any other willing participant to the developers listing of the app and
share the code in SVN.

Greets,
Bram

On Tue, 2009-12-15 at 23:47 +0900, Tatsuhiro Tsujikawa wrote:
> It would be good to create it in google apps engine, isn't it?
> I'm very much interested in GAE recently.
>
> Best regards,
>
> Tatsuhiro Tsujikawa
>
> --
>
> You received this message because you are subscribed to the Google Groups "Metalink Discussion" group.
> To post to this group, send email to metalink-...@googlegroups.com.
> To unsubscribe from this group, send email to metalink-discus...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/metalink-discussion?hl=en.
>
>


Anthony Bryan

unread,
Dec 15, 2009, 8:45:05 PM12/15/09
to metalink-...@googlegroups.com
On Tue, Dec 15, 2009 at 5:09 PM, Bram Neijt <bne...@gmail.com> wrote:
> Hi,
>
> I'd be happy to create it. I've already written dynmirror.net in the
> google app engine, and I'd be happy to set up another app or create a
> page at my virtual server (logfish.net).
>
> Recently I finished my master thesis (last week), so I'm also free to
> poor some time in this. I'd be happy to do it.

congrats, Master Neijt!

> Any comments are welcome, but if nobody has more to say then I will open
> a Google app-engine and start coding. I'd be happy to add Tatsuhiro and
> any other willing participant to the developers listing of the app and
> share the code in SVN.

it's probably about time for a validator service. that would be a well
needed addition.

any luck on the Chrome extension?

> On Tue, 2009-12-15 at 23:47 +0900, Tatsuhiro Tsujikawa wrote:
>> It would be good to create it in google apps engine, isn't it?
>> I'm very much interested in GAE recently.



Hampus Wessman

unread,
Dec 16, 2009, 10:09:56 AM12/16/09
to metalink-...@googlegroups.com
On 2009-12-15 23:09, Bram Neijt wrote:
> Hi,
>
> I'd be happy to create it. I've already written dynmirror.net in the
> google app engine, and I'd be happy to set up another app or create a
> page at my virtual server (logfish.net).
>
> Recently I finished my master thesis (last week), so I'm also free to
> poor some time in this. I'd be happy to do it.
>
Nice!
> Any comments are welcome, but if nobody has more to say then I will open
> a Google app-engine and start coding. I'd be happy to add Tatsuhiro and
> any other willing participant to the developers listing of the app and
> share the code in SVN.
>
That sounds good to me! Add me too. I can always help out a bit, even if
I focus on my editor right now.
Reply all
Reply to author
Forward
0 new messages