Posts Tagged ‘XML’

Sufferin Semantics! XML, HTML, jQuery, and MSIE

Thursday, February 4th, 2010

So, in a recent project, I’m consuming xml data and pulling out some text for a description field on an html page.  I’ve got some basic stuff, text for title information, paths to asset files stored as node attributes, the usual.  But something is bugging me.  I’ve included some html in my descriptions, all formatted according to xhtml standards, but it won’t be parsed by jQuery.

Dagnabit!  What is the point of combining xml and html standards if I can’t use them together all the time?  I know, you may be thinking, but xml is not html , no matter what you throw into your nodes.  You’re right, and this is exactly what jQuery tells us.  You can grab the text contents of any node, but if you have html tags in there, the .text() method in jQuery will just look right past them.  As it should.  This works fine, for little snippets like my titles, but what if I want to put some (ostensibly) well-formatted html code in my data?  Further, what about all those applications where you want to store html snips in a database and read them out in XML?  How do you get around this?

(more…)

Semantic HTML Literacy

Friday, October 30th, 2009

Since shortly after people started using markup to organize data, the dream has been knocked around that one day the structure and the content would become seamlessly intertwined.  However, this is a tiny bit counterintuitive, as I see it, as one of the features of XML, for example, is to delineate data and content apart from the meta-data that applies to it.

The real dream has been that one day, HTML and XML would be combined (not just in terms of the XHTML standard), and that the web would turn into a big soup of meta information.  This would allow all sorts of wonderfully customizable content, searching, cross-threading, and possibly, someday, even help create some kind of internet based solely on context, rather than infrastructure and IP.  Positives: super-personalized web-browsing, advertisements, and content aggregation.  Negatives: super-personalized web-browsing, advertisements, and content aggregation.

But I digress.  The flock to div tags as cleaner and more semantically meaningful has been a beneficial one, but for we web developers who remember the [good?] [bad?] old days, there are more than a few cases in memory of the development community rushing en masse to the next greatest thing, and then flipping it into reverse with the release of the next IE browser / web standard / greatest thing.

(more…)