3 ms·
I'm really hesitating to comment. It's way too easy for us types to miss really good ideas due to our preconceptions. But it's hard for me to look past the fact
by madair 17y ago
I'm really hesitating to comment. It's way too easy for us types to miss really good ideas due to our preconceptions. But it's hard for me to look past the fact that this looks like a really bad abstraction over the top of the structure document abstraction that was designed specifically to suit NPR's purpose.
For example, they show the <em> tag being stored by position in the database separately from the content itself, seemingly unaware of the significance that <em> is a semantic tag. It means emphasis. If the iPod doesn't like <em> for emphasis, well then that's why it's a semantic tag. You can remove semantic tags or replace them with alternative markup or binary formats as needed because they have meaning designed for parsing and formatting.
It's all well and good to hate on XML for inappropriate uses. But, critical point here, documents are what XML is for! And there is a shocking wealth of libraries in just about every language available today that will handle document markup just fine.
It seems to me to be a quintessential reinvention of the wheel, and the XML hating has just gone on too far at this point.
- pradocchia 17y agoIt's a lot cheaper to insert your markup by position than to parse the XML on every read. Of course, caching would mitigate much of that, but still I admire the design.
- patio11 17y agoYou wouldn't even have to parse the XML -- just anoint one form the canonical internal representation and then have filters which turn the internal representation into other formats. For example, if you store all documents in a restricted version of HTML, then you can generate a text-only version by replacing all <em> and </em> with star, etc. This is much cheaper than actually parsing XML (no need to build up a data structure representation of the document, just assume it is mostly right already and apply textual transformations). Then, once you have the plaintext version, cache it. Journalism sites are going to have an absurd number of reads to writes. (One guy writes the article, one guy edits it, 50,000 people see it within a minute of it being posted.) Caching is cheap and easy. Caching is robust against the article changing, too -- you purge the cache (or potentially just let it expire) and bam your new article is mostly right, whereas tracking the offset of <em>s seems to intuitively have a lot of possible failure modes to me. (For example, the first time one of your reporters tries to add a bit of local color with Japanese text in an article, I'll bet dollars to donuts that every tag after the Japanese breaks and the surrounding content gets corrupted.)