#4 Patch for bug 890053

closed-accepted
Sam Ruby
None
5
2004-02-16
2004-02-12
Joseph Walton
No

This patch extends the validators to have explicit sets
of the attributes that are permitted. Anything outside
that set is warned about. All RSS 2.0 attributes are
covered; the only other feed attributes known about are
the ones included in the test suite. Pass/Fail tests
included, and an explanatory web page.

Discussion

  • Joseph Walton
    Joseph Walton
    2004-02-12

    Warns about unknown attributes

     
  • Sam Ruby
    Sam Ruby
    2004-02-16

    Logged In: YES
    user_id=141556

    WOW!

    I made a few changes, but overall I accepted the approach
    taken. The bulk of the changes made were:

    1) Moved the check from the end element to the start
    element, which will more appropriate report the location of
    the error
    2) This patch bypassed the check for elements which did not
    declare any expected attributes... any attributes present on
    such elements should be reported as an error.
    3) As a result of (2), the test case did not report all the
    missing attributes, such as the ones on enclosure.
    4) There are "builtin" attributes in xml, such as lang and
    base... these need to be handled.

    Despite this, I am *VERY* impressed for such a high quality
    patch to have been submitted without requiring any assistance.

    Suggestion: if you think that there is possibility of you
    ever doing this again, try subscribing to

    http://lists.sourceforge.net/lists/listinfo/feedvalidator-users

    first.

    Thanks!

     
  • Sam Ruby
    Sam Ruby
    2004-02-16

    • assigned_to: nobody --> rubys
    • status: open --> closed-accepted
     
  • Joseph Walton
    Joseph Walton
    2004-02-18

    Logged In: YES
    user_id=847250

    Nice fix-up; I agree with all those changes. I'd already
    made a couple of them myself, in a slightly clumsier fashion
    (I'm new to Python!), and I've attached the few remaining
    differences from my tree (removed use of ImmutableSet from
    item.py, also allow xml:space, and added the full set of
    xml: attributes to the test case).

    (Also subbed to feedvalidator-users; thanks.)

     
  • Joseph Walton
    Joseph Walton
    2004-02-18

    Post-fix tidy-up

     
  • Sam Ruby
    Sam Ruby
    2004-02-18

    Logged In: YES
    user_id=141556

    Second patch applied (I didn't know that you could append a
    file to a closed patch!).

    FYI: the reason I changed to avoid ImmutableSet was that it
    does not exist on Python 2.1. Thanks for catching the
    remaining instances in item.py.