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

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading



Kofi Sarfo modified theme by Mads Kristensen



Content by WIMIRO Technology is licensed under a Creative Commons Attribution-Share Alike 2.0 UK: England & Wales License.

Creative Commons License

Powered by BlogEngine.NET 1.5.0.7

About Me

Director, Wimiro Technology
London, United Kingdom

Writes in third person and first person plural; currently commutes to Liverpool St Station.

Kiva Loans

  • Cristal Group

    Cristal Group

    Sewing

    Requested loan: $3775

    Amount raised: $0

    Asunción, Paraguay

    Buy fabric, thread, and buttons

    Loan Now »

  • Tanith Tapullima Flores

    Tanith Tapullima Flores

    Fruits & Vegetables

    Requested loan: $725

    Amount raised: $0

    San Martín, Peru

    To buy fruit to stock her business

    Loan Now »

  • Margarita Quispe Socclla

    Margarita Quispe Socclla

    Tailoring

    Requested loan: $200

    Amount raised: $0

    Cusco, Peru

    Margaria needs a loan to buy thread, cloth, and materials for sewing

    Loan Now »

 To see more entrepreneurs »

Kiva Loans