The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Why client side strictness is wrong

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Why client side strictness is wrong Posted: Jan 14, 2004 7:46 AM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Why client side strictness is wrong
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Cincom Smalltalk Blog - Smalltalk with Rants

Advertisement
Mark Pilgrim explains in complete detail why insisting that clients reject invalid xml out of hand is a bad idea. The best part is, as I write this, he has four perfect examples:

Norman Walsh (invalid XML), Danny Ayers (invalid XML), Brent Simmons (invalid XML), Nick Bradbury (invalid XML), and Joe Gregorio (invalid XML claiming to be HTML) have all denounced me as a heretic for pointing out that, perhaps, rejecting invalid XML on the client side is a bad idea. The reason I know that they have denounced me is that I read what they had to say, and the reason I was able to read what they had to say is that my browser is very forgiving of all their various XML wellformedness and validity errors.

All of those folks have been extremely insistent that aggregators should reject bad content out of hand. All of those folks have invalid feeds on that basis right now. The lot of them need to read the rest of Mark's post; they should consider what he has to say carefully. Here's how I checked the validity myself:

I used this code to check whether a feed was valid xml - it just grabs the source xml, and tries to parse it - without handling any errors

source := 'http://inessential.com/xml/rss.xml'.
parser := XMLParser new.
parser validate: false.
doc := (HttpClient new get: source) contents.
^parser parse: doc

I used this snippet of BottomFeeder code to make sure that the invalid xml was getting handled:

doc := Constructor  
	documentFromURL: 'http://bitworking.org/index.rss' 
	forceUpdate: true 
	useMaskedAgent: false.
cls := Constructor determineClassToHandle: doc.
target := cls objectForData.
feed := cls 
	processDocument: doc
	from: 'http://bitworking.org/index.rss' 
	into: target.

In each case, the simple parse fails with an error, while the BottomFeeder framework deals with the error and produces the content I want to see.

Read: Why client side strictness is wrong

Topic: Re: The Behavior of Behavior Previous Topic   Next Topic Topic: Data Without Meaning

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use