Separating Content from Presentation: Easier Said Than Done
We say it so often we don't even listen to the words any more. "Separate
content from presentation" with XML. Information should not be
inter-twingled with any one presentation as the presentations may
(indeed will) change over time. New browsers, new devices of all sorts,
oodles of document formats -- all can be targeted from a single source
XML document. So sayeth the fundamental lore of XML.
Although this works fine for the most part, there are some situations
where it is not really possible in practice. There are some cases where
the content and the presentation are so deeply intertwined that
separating one from the other is far from straightforward.
Four cases spring to mind: graphics, tables, mathematics, and advanced
typography.
Lets deal with the graphics problem first. Graphics come in two main
flavors -- vector and bitmap. Vector graphics are quite in keeping with
the ethos of separating content from presentation espoused by XML.
Vectored formats concentrate on capturing the semantics of an image --
in terms of fundamental units such as lines, circles, fills and so on.
The objects are laid out on a virtual space. At the point on rendering,
a mapping between the virtual space and the physical space is made to
achieve the best possible rendering given the limitations of the
rendering device e.g. area in pixels, color depth and so on.
Bitmapped graphics on the other hand, are intimately tied to a
particular rendering in terms of pixel area and color depth. Bad things
typically happen if you try and resize bitmapped images as the pixels in
the image do not encode any semantics about what the image represents.
In short, they cannot be repurposed to different shapes, sizes or color
schemes without significant loss in quality.
So, surprise, surprise, when it comes to graphics and XML, vector
formats are much more in tune with the ethos of separating content from
presentation. However, there are times when a bitmapped approach is the
only one available. The images may represent facsimiles of documents
that have a legal status and therefore must be reproducible *exactly*.
No amount of philosophical twaddle about the benefits of generating
renderings from logical representations of the information will cut it
in a court of law.
We turn now to tables. If I had a penny for every second by cerebral
cortex has pondered the mysteries of tables, I would be writing this
from my hideaway Island in the Pacific via a dedicated 1GB satellite
link.
Tables have a quantum feel to them. The more you look, the more the act
of looking seems to affect their very nature. At first glance, it would
seem possible to dissect most tables into semantic structures but as you
look closer, this possibility typically sails into the sunset leaving
you with a model of rows and columns and alignments and tab stops and
vertical offsets and spans and ... So much for separating the content
from the presentation!
Sign up for ITworld's Daily newsletter
Follow ITworld on Twitter @IT_world
Esther Schindler
If the comments are ugly, the code is ugly
claird
SVG a graphics format for 21st century
pasmith
Take Chrome OS for a test spin
Sandra Henry-Stocker
Solaris Tip: Have Your Files Changed Since Installation?
jfruh
Android fragments vs. the iPhone monolith
mikelgan
What Gizmodo missed about the Pro WX Wireless USB disk drive
Sidekick: The Good News & the Bad News
Either way you look at it Microsoft Data Center management did not follow standards or best practices in this failure. In which case it makes me wonder more about the outsourcing of corporate data much less personal data.
- mburton325
Join the conversation here
Quick, practical advice for IT pros. Made fresh daily.
Want to cash in on your IT savvy? Send your tip to tips@itworld.com. If we post it, we'll send you a $25 Amazon e-gift card.













