Free Newsletters
Technology & Business Daily

InfoWorld
Log-in | Register

  Thursday, October 09, 2003 

Interactive microcontent

The friction that really wears us down is at the interface between people and data. I'm not too worried about how we represent XML fragments, but very curious about how we enable people to interact with them. These little experiments are hardly conclusive, but they do hint at the still-untapped potential of the scriptable document object model. [Full story at O'Reilly Network]

A glitch that affected the live examples in that article is being repaired. Meanwhile, I'm reproducing the examples here. The first is a DOM-aware citation bookmarklet (Mozilla-only, alas). This is the text of the bookmarklet:

javascript:(function(){var element=document.createElement('script'); element.setAttribute('src','http://weblog.infoworld.com/udell/gems/quote.js'); document.body.appendChild(element); })()

And here's the actual quote bookmarklet, draggable to your linkbar if you're running Mozilla.

The next example uses similar technology to find a fragment of XML matching some pattern, lift it out of a web page, and do something with it. In this case, the fragment is simply echoed to a window. One link finds a fragment with a cal:date attribute, the other finds the enclosing fragment with a cal:range attribute. Click on one or the other of the events to set focus first.

grab calendar event, grab calendar events

Here's the schedule:
Red Sox vs. Yankees Saturday 4PM
Fenway Park
Red Sox vs. Yankees Sunday 7:30PM
Fenway Park

Just this morning, I read a well-reasoned argument on the fragility of XHTML. I can't really disagree, it's true that the effort/reward ratio is currently out of whack. But for what it's worth, I'm looking for ways to reduce the effort required to create and maintain the stuff, and increase the rewards for doing so. Note that in the case of these calendar fragments, it's not actually necessary for the whole page to be valid XHTML. Well-formed fragments contained within documents that are not themselves guaranteed to be well-formed is a possibility, and maybe a useful possibility.

Update: When I transplanted the calendar example from the ORA site to here, I noticed something odd, the significance of which didn't sink in until just now. The sample fragment in the published article was not well-formed. I wrote the article in an XHTMLish way, but didn't vet it for well-formedness -- as I do now for what I write here. As it turns out, the table containing the calendar fragment was ill-formed. I've corrected the version shown here, just to keep my XML database clean, but the fact is that I could have published the ill-formed content, exploited the leniency of the browser, and still been able to extract well-formed fragments from it. Hmmm.

 


Recent Entries


















































Sponsored Technology Links

 
 
 HOME  NEWS  BLOGS  PODCASTS  VIDEOS  TECHNOLOGIES  TEST CENTER  EVENTS  CAREERS   About | Advertise | Awards | RSS | Contact Us 

Copyright © 2008, Reprints, Permissions, Licensing, IDG Network, Privacy Policy, Terms of Service.
All Rights reserved. InfoWorld is a leading publisher of technology information and product reviews on topics including viruses,
phishing, worms, firewalls, security, servers, storage, networking, wireless, databases, and web services.

CIO :: ComputerWorld :: CSO :: Demo :: GamePro :: Games.net :: IDG Connect :: IDG World Expo
Industry Standard :: IT World :: JavaWorld :: LinuxWorld :: MacUser :: Macworld :: Network World :: PC World :: Playlist