I see a lot of XML code at Goodreads while working on their iOS app, but some time ago I realized I didn’t have an easy way to see the XML source of a given API response on the iPad. Incidentally, when I realized that I was in bed, and the iPad was the only device within my reach.
So I found this script on ravelrumba.com which worked fine for HTML pages, but not so much with pure XML content.
XMLSerializer:: serializeToString(), which serializes a XML tree to a string.
Here’s the whole thing. Just add it as a bookmarklet on your Mobile Safari bookmarks bar:
Source of '+location.href+'');a.close();var b=a.body.appendChild(a.createElement('pre'));b.style.overflow='auto';b.style.whiteSpace='pre-wrap';b.appendChild(a.createTextNode((new XMLSerializer()).serializeToString(document.documentElement)))})();
Cory Doctorow nailed it about the iPad:
“The iStore lock-in doesn’t make life better for Apple’s customers or Apple’s developers. As an adult, I want to be able to choose whose stuff I buy and whom I trust to evaluate that stuff. I don’t want my universe of apps constrained to the stuff that the Cupertino Politburo decides to allow for its platform. And as a copyright holder and creator, I don’t want a single, Wal-Mart-like channel that controls access to my audience and dictates what is and is not acceptable material for me to create.”
What kind of spell did Jobs cast on us to make us accept these terms? A computer where we have almost no control on it, yet we want to pay for it?
What is happening to computing?
Around 10 years ago we were horrified by TCPA and Palladium and Trusted Computing and all those future DRM technologies that evoked a really sinister aura of devices whose content we’d be unable to control. But… this is it! It is happening! It has already happened with the iPhone actually. At that time I imagined the killer app that would make this possible was going to be entertainment, and here it is. Everybody loves to be entertained. Now you have a fast and sleek device for it. With a great, “approved” user experience.
The genius here is that Apple understood that to make this happen — to have people accept it — they had to invent a brand new class of devices. Nobody will accept a classic computer with those locked-in limitations. And since the iPad is “revolutionary” and fast, sexy, beautiful, with an engaging UI, people will feel compelled to accept the compromise.
Apple invented a beautiful new device to do whatever the fuck they want, no matter how dirty. But they left the hackers out. Mind you, this is the same company (but is it really?) who made the Apple II+, which shipped with schematics.