W3C home > Mailing lists > Public > www-style@w3.org > April 1998

Why XML can't be displayed directly

From: Todd Fahrner <fahrner@pobox.com>
Date: Wed, 15 Apr 1998 11:33:49 -0700
Message-Id: <v03102805b15aa52424e3@[]>
To: www-style@w3.org
Why - because CSS support isn't good enough! As I've charged in a few fora,
it looks to me like halfway CSS implementations are dragging "creative"
HTML into the mix as a necessary crutch for display of structured
information. And this is very convenient if you'd like neither to have to
pay attention to HTML's design strengths nor ever to have to think of XML
as a document format, suitable for viewing with a simple stylesheet rather
than being dependent on a transformation engine and an extraneous HTML

Below is an exercise in simple transformation of Potted Plant Markup
Language (PPML) instances to HTML. Basically it's a bunch of nested DIVs
with class/id attributes to preserve the original XML semantics.

Check out the rendering. It's broken in the few CSS browsers I've tested.
The brown boundary should completely contain the black (as the pot contains
the dirt), and the black should completely contain the dark green "stems".
This failure isn't a surprise to me, but it does explain simply why, say,
XSL stylesheets will be used more frequently to produce GIF-and-table-style
HTML from XML rather than HTML that can be restyled, and that might
actually preserve the relevant structure and semantics of the source.

		<style type="text/css">
DIV {padding: 1em; }
.pot {background: brown; }
.dirt {background: black; color: white; }
.stem {background: green; }
.leaf {background: #0F0; color: red; }
		<div class="pot">
			 I contain everything. I am called root, not to be confused
with roots. Kettles are black.
			<div class="dirt">
				 Containing, I am contained.
				<div class="stem" id="1">
					 I came first.
					<div class="leaf">
						 I'm a leaf.
				<div class="stem" id="2">
					 but I'm less fibrous.
					<div class="leaf">
						 I'm a leaf too.
				<div class="stem" id="3">
					 I'm the baby.
					<div class="leaf">
						 I'm the widdewest weaf.

Todd Fahrner
Received on Wednesday, 15 April 1998 14:27:13 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:47 UTC