Sign In/My Account | View Cart  
advertisement

Article:
 Parsing RSS At All Costs
Subject: Agreed. So what's your solution?
Date: 2003-01-30 09:00:19
From: Jon Wickström
Response to: Agreed. So what's your solution?

In this case with RSS. I believe the providers of the feed should care enough for it to check that it is not broken. And if the document is broken, how much should you fix it? There might be bits and pieces missing or completely wrong. If the document is silently fixed, how are you to know what you are missing?


If the document has two root elements, which one would you choose? Both? Should open tags be closed? Maybe the content of the document still is broken?


On the other hand. It would be very convenient in an RSS client when an invalid document is encountered to have a pop-up asking "Fix broken document? Yes/No". But I think the key point is to inform the user that the document is broken!
And if the RSS feed is fed into something else a notation that the document has been modified must be included...


Should this bee seen in a bigger context. Should all XML documents be fixed by the parser? Only well-formedness or also if not valid?


From a programmers standpoint it is very nice to know that you can (and should?) throw away a broken document because parsing it otherwise probably would propagate errors.


Previous Message Previous Message Move up to Parent Message Up Next Message No Next Message


Sponsored By: