The Poor Man's XLink-Like Thing

by Kofi Sarfo 23. September 2009 01:18

The following StackOverflow post is interesting not so much because of the text but how it's rendered.

Loading Stack Overflow post...

We begin with a <div> tag which contains an expected id attribute format and using a jQuery regular expression we're able to match all div elements with an "id" attribute beginning "RSSContent".


<div id="Container">
<div id="RSSBlock">
<div id="RSSContent200909222115"
runat="server"
title="http://stackoverflow.com/feeds/question/477962" />
</div>
</div>

The "title" attribute for each element matched is used in an HTTP post of content-type application/json to a web service which acts as a proxy to overcome cross-scripting JavaScript constraints. This returns the post above which I found useful recently.

It's not an elegant solution. I've hacked the div element, using the "title" attribute to hold the URL and the directory structure isn't great either. The web service creates a user control which appears to work only in the root directory and the web application project requires a reference to an identical control in another project. The things we do for code compilation!

The end result is that rather than cut & paste, which would have been far easier we're using using an external resource to supply text so that if the RSS feed item was to change, for example, then we'd still display the most current version.

An XLink implementation, this is not. It's just an example of how I thought the web might work sometime soon after 2001... What we're missing here, conceptually at least, is meta to describe the relationship between this post and the one referenced. Well, in this case the meta is only human-readable and quite incomplete.

Tags: ,

JSON | Toys

Kiva Loans

  • Makenzi Makau

    Makenzi Makau

    Grocery Store

    Requested loan: $200

    Amount raised: $0

    , Kenya

    To buy cabbages and oranges to sell.

    Loan Now »

  • Andrew Katushabe

    Andrew Katushabe

    Pub

    Requested loan: $875

    Amount raised: $0

    Mubende, Uganda

    to buy more drinks such as soda and beer for resale.

    Loan Now »

  • Jessica Joguilon

    Jessica Joguilon

    Pigs

    Requested loan: $350

    Amount raised: $0

    Valladolid, Negros Occidental, Philippines

    to buy feeds and vitamins for her pigs.

    Loan Now »

To see more entrepreneurs »

Make a loan to an entrepreneur across the globe for as little as $25. Kiva is the world's first online lending platform connecting online lenders to entrepreneurs across the globe.