List Info

Thread: inappropriate error message for leading space in URL




inappropriate error message for leading space in URL
country flaguser name
United Kingdom
2007-10-16 11:16:34
The newsfeed at:
    http://rss.oucs.ox.ac.uk/offices/university-news/rss20
.xml
produces three warning messages when passed to
feedvalidator.org.

There are 141 occurrences of:
    Email address is not in recommended format 
which I understand.  There is also one occurrence of:
    Missing atom:link with rel="self"
which I also understand.

However, I'm interested in the warning message:
    description should not contain relative URL references
It's objecting to line 530 which is:
  <description>An Oxford study shows that antibiotics
such as
    amoxicillin given to children have no long-term effect
to
    the child but contribute to a high level of antibiotic
    resistance in the population.
    &lt;img src=" http://www.admin.ox.ac.uk/po/graphics/news%20sma
ll/27s.jpg"
    alt="boy taking antibiotics" /&gt;
  </description>

I was intrigued why this warning message only occurred once
as this style 
of description element is used for all of the items in the
feed.

However, after a closer look at this item, I noticed that
for this item 
there is a leading space in the URL, i.e., it has "
http:" rather than 
"http:".  I think that that is illegal according
to section 3 of 
http://www.ietf.
org/rfc/rfc2396.txt.

Is it easy/a-good-idea to improve on the warning message
that is given
in this situation?
    "description should not contain relative URL
references"

--
Barry Cornelius            Computing Services, University of
Oxford
                                13 Banbury Road, Oxford, OX2
6NN, UK 
barry.corneliusoucs.ox.ac.uk  Phone:01865 273267 or
+441865 273267
http://www.barrycorneli
us.com        Reception:273200    Fax:273275


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "feedvalidator-users" group.
To post to this group, send email to feedvalidator-usersgooglegroups.com
To unsubscribe from this group, send email to
feedvalidator-users-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/feedvalidator-users?hl=en

-~----------~----~----~----~------~----~------~--~---


Re: inappropriate error message for leading space in URL
country flaguser name
United States
2007-10-16 11:49:38
Barry Cornelius wrote:
> 
> However, after a closer look at this item, I noticed
that for this item 
> there is a leading space in the URL, i.e., it has
" http:" rather than 
> "http:".  I think that that is illegal
according to section 3 of 
> http://www.ietf.
org/rfc/rfc2396.txt.
> 
> Is it easy/a-good-idea to improve on the warning
message that is given
> in this situation?
>     "description should not contain relative URL
references"

I've improved the logic.  As with many issues, this one has
layers.

The code in question is looking for relative URI references,
a common 
issue with RSS feeds.  When it sees something it doesn't
like, it 
confidently reports on the most common reason for that
situation, which 
in this case is, as you put it, inappropriate.

Yes, space characters are illegal inside a URI.  But that
begs the 
question: in this case, where does the URI start and where
does it end? 
  That turns out to be a HTML question, and assuming the
role of being a 
full HTML validator is beyond the scope of this section of
code at this 
point in time.  Besides, in the one browser I tested,
leading and 
trailing spaces in href attributes are ignored.

So, I've done this:

  * Before validating, I strip leading and trailing
whitespace.

  * Then I validate that each character is a valid URI
character.  If
    not, I will report on that.  This will catch spaces
inside a URI.

  * If there are no errors found so far, then the previous
logic will
    take over.  In most cases, the message it provides will
be correct
    and helpful.

- Sam Ruby

P.S.  Bug reports such as these are most helpful.  Thanks!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "feedvalidator-users" group.
To post to this group, send email to feedvalidator-usersgooglegroups.com
To unsubscribe from this group, send email to
feedvalidator-users-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/feedvalidator-users?hl=en

-~----------~----~----~----~------~----~------~--~---


Re: inappropriate error message for leading space in URL
country flaguser name
United Kingdom
2007-10-16 12:00:22
On Tue, 16 Oct 2007, Sam Ruby wrote:
> ...
> So, I've done this:
>  * Before validating, I strip leading and trailing
whitespace.
>  * Then I validate that each character is a valid URI
character.  If
>    not, I will report on that.  This will catch spaces
inside a URI.
>  * If there are no errors found so far, then the
previous logic will
>    take over.  In most cases, the message it provides
will be correct
>    and helpful.
> ...

Thanks.

--
Barry Cornelius            Computing Services, University of
Oxford
                                13 Banbury Road, Oxford, OX2
6NN, UK 
barry.corneliusoucs.ox.ac.uk  Phone:01865 273267 or
+441865 273267
http://www.barrycorneli
us.com        Reception:273200    Fax:273275


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "feedvalidator-users" group.
To post to this group, send email to feedvalidator-usersgooglegroups.com
To unsubscribe from this group, send email to
feedvalidator-users-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/feedvalidator-users?hl=en

-~----------~----~----~----~------~----~------~--~---


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )