[wp-hackers] JSON Syndication
Elliotte Harold
elharo at metalab.unc.edu
Mon Feb 19 17:04:30 GMT 2007
Matt Patenaude wrote:
> Second, though, I would like to suggest a feature. For the past few
> months I've been getting fed up with XML, and getting to know JSON. XML
> can be quite clunky, and really isn't suited for syndication when you
> think about it.
I call shenanigans on this. XML is exactly suited for serialization, and
JSON isn't. You cannot easily pass syndication feeds in simple
name-value maps. There's too much structure there that you lose when
doing that. If what you have is a name-value map, then JSON may be
simpler. Syndication data is not made up of name-value pairs though.
The problems RSS had were the result of avoiding XML and trying to make
it more like JSON. We've been down that road already. It didn't work.
That's why there's now Atom.
> JSON, on the other hand, is a very lightweight data
> serialization language, which greatly improves size and simplicity of
> use of syndicated content (it has direct relationships to programming
> structures, so it's easier to access programmatically than XML through
> the DOM).
Well I certainly wouldn't suggest anybody use the DOM, but there are
alternatives. The problem is DOM, not XML. Try XQuery, XSLT, XPath, or
XOM to name just a few.
> I'm trying to get a movement going of a syndication format made
> completely in JSON. The first step, I figured, was to develop an
> informal specification:
> http://howto.blogwithtux.org/index.php?title=JSON_feed.
The syndication format I see there is much simpler than what people are
sending today with Atom. It is essentially a variation of the original
RSS specs which were massively oversimple for the use case, resulting in
truly ugly hacks to account for things people needed to do that RSS
couldn't. Please consider the needs of full text feeds with embedded
markup. Once you do that JSON's no longer so simple.
And I'm not even talking about the inevitable security bugs that are
going to open up if people begin executing JavaScript code that
syndicators send them.
--
Elliotte Rusty Harold elharo at metalab.unc.edu
Java I/O 2nd Edition Just Published!
http://www.cafeaulait.org/books/javaio2/
http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/
More information about the wp-hackers
mailing list