XHTML is just data

The other day, I asked:

What if we think about the Web this way:

  • XTHML = Model
  • CSS = View
  • {Java/EMCA/DOM}scripting = controller

Tantek responded with:

I think this makes a lot of sense. In fact, see:


for some thoughts on the matter. Interesting that we both drew the same analogy.

I do think you made an additional good point about now with AJAX, XCJ/MVC considerations are perhaps more important than ever.

I’ve thought about this more over the last few days and I have a few thoughts

  1. I think this is really important given the whole AJAX craze. Developers and designers need to be extra careful to be sure that they find a balance between dynamic interfaces and open, query-able HTML-as-api interfaces. These two movements are worthwhile, but could easily interfere with each other (well, really I’m just talking about AJAX interfering with having consumable HTML).
  2. I’ve been trying to think of how we could apply what we know about MVC to XCJ, but its tough because of a key difference. In my understanding of MVC, the Controller is somewhat of a primary component, coordinating the active of the other two. In XCJ, the XHTML is the primary component, which coordinates the other two pieces by linking to or including them inline. I’m not sure what the implications of this are.
  3. In the FOO Camp Wiki page which Tantek links to in the above-referenced post, there’s a comment which says:

    where do you go beyond MVC?

    data structure patterns in XHTML

    If we’re going to think of XHTML as ‘just-data,’ it would be useful to think of its structures like datastructures. It seems that we have some XHTML data structures already. Some simple analogies:

    And for multi-dimensional data we could either nest these simple structures or use tables.

  4. Thinking about XHTML as just data could really change the way people develop websites.

XCJ is the logical conclusion of the semantic html, microformats, html-as-api ideas. Each of these are attempts to make the Web more data- and meaning-rich while building on current tools.

Once presentation has been banished to CSS-siberia and behavior to Javascript-jail, all that’s left is data, right?

3 Responses to “XHTML is just data”

  1. Tantek Says:

    Your continued analysis is correct.

    Regarding your Thought #2, the difference between MVC and XCJ being that one is code-centric, and the other, data-centric. Personally I think the data-centric model makes much more sense, since you care about your data lasting much longer than your code (people upgrade and abandone applications/os’s all the time, while they care a lot about keeping their documents, their photos, their music, their *data*).

    On the whole XHTML is just data theme, check out the presentation “Can your website be your API”, where Kevin and I drew many of the same data structure analogies that you did:



  2. ryan Says:

    I think data-centric is probably a more useful methodology, I was just trying to make the point that this is where the analogy breaks down and for this reason its tough to apply MVC concepts to XCJ.

  3. l.m.orchard Says:

    For what it’s worth, the page and the site is a bit of a mess, but I tried implementing a sort of HTML/CSS/JS MVC system on the non-Flash version of fordvehicles.com which launched around last October.

    Check out this page:

    Play with the key features scroll strip and billboard, as well as the rollover expand/collapse promos. Then, if you view source, trudge through the mess, search for a DL tag with a class of “stripScroller”. This little oasis of proto-microformat HTML, with its accompanying CSS and JS includes, is what I’m talking about.