Let’s say that, from a single point in this document, I want to refer you to several things at once. Modeling this one-to-many link and marking it up is simple enough with XML: you create a container element that holds other elements, each representing a link destination. But what do you do with that markup? How do you turn it into a choice of link destinations to offer to an end user?
One old-fashioned option is so simple that many won’t even think of it as a one-to-many link: you add a layer of indirection by pointing to a single page that has the links you want. For example, “If you’re interested in Unicode’s role in XML, many good references are available.”
The most obvious user-interface widget for a more direct one-to-many link is a pop-up menu. Implementing it on a web page pulls you into the classic platform/browser-app/browser-release quicksand quickly enough, but it’s still fun to play with. I took a nice JavaScript library and used it to create a prototype of one-to-many linking from an XML document displayed in a browser, and that came out pretty nicely, depending on your platform/browser/release combination; I also explained the workings of the XSLT underneath in an XML.com column.
Some developers, though thankfully not too many, seek a compromise between these last two ideas by popping up a new browser window with a small document listing the link destinations, like in this reference the W3C Schema Recommendations. With the browser’s navigation bar, menu, and other optional decorations removed, it looks a bit like a pop-up menu, but it’s still a new browser window, and any new browser window on a screen should be there because the user asked for it, not because a developer wanted it there. In this paragraph’s link I made the window small to look more like a pop-up menu, but if you follow one of its links, it puts the target resource in the same little window. You could tackle this using even more Javascript, but again… quicksand.
One nice, simple trick I’ve been seeing combines HTML with simple punctuation to group the link destinations: a parenthesized, delimited list of HTML a elements. For example, “Earlier this month, several new RDF Working Drafts (1, 2, 3, 4, 5, 6) were released.” I’ve seen Jon Udell do this with commas as the delimiters, as I did here, and I’ve seen Slashdot use pipe symbols. Either way, despite its lack of whiz-bang UI flash (or, more likely, because of it), it works on every browser, and an XSLT transformation from any higher-level XML-based representation of one-to-many links into this format is simple. You could even add more sophisticated linking features to this interface by setting the numbers in different colors to show link types or by adding title attributes to the numbers’ a links to show metadata in mouse-over popups, as I did with the RDF example.
Has anyone seen other variations on this use of delimited lists as one-to-many links? What’s the earliest use you’ve seen of this?
Because linking has always been so important to the web, many people looked forward to the W3C’s XLink specification because of its promise of delivering the next generation of linking. While it did show ways to model one-to-many links with extended links, it didn’t show ways to implement them—in fact, it intentionally avoided this to keep the data structures it described high-level enough so that they could be implemented on a variety of platforms. The trouble was, practically no one implemented them, so people still wonder: how should they be implemented? You don’t need advanced technology (as I’ve written here before, Frank Shepard was doing it in the nineteenth century, and Bibles were doing it long before that), but part of the fun of new technology is the new possibilities it opens up. It’s only natural to wonder what new options new user interface developments will offer us for representing one-to-many links.
How have you seen one-to-many links implemented?