[CLUE-Tech] PHP/XML and CDATA Woes: The Answer

Matt Gushee matt at gushee.net
Thu Feb 12 22:47:21 MST 2004


On Wed, Feb 11, 2004 at 07:11:10AM -0700, Dale K. Hawkins wrote:
> Matt Gushee <mgushee at havenrock.com> writes:
> 
> >  * But I can help if need be.
> 
> OK, let's say I am trying to convince someone to utilize XML for their
> website creation.  What are the main selling points for the added
> hassle and transformations?

If you're looking for a sales pitch, you got the wrooooong guy!

But seriously, I think your question is a good one, and am contemplating
a thoughtful answer to it--but that could take a while, and anyway it
feels more like an essay than a mail message. So maybe it's time to
finally get off my butt and get my blog on line. Meanwhile, I will
sketch out one or two important points.

First of all, who is your "someone," and what kind of Web site do they
need? Without answering that question, it is impossible to say whether
or how they should use XML. In fact, I don't believe XML should even be
thought of as a general-purpose tool for building Web sites. It can be
useful for complex data-centric Web applications (something like an
interactive knowledge base being an archetypal example), and it is also
very handy for syndicated content such as news feeds. But use XML for
ordinary Web pages? Uh-uh.*

It's a bit sad to have to say this, because in the beginning XML was
specifically intended as a _web publishing technology_. But some of the
key pieces of supporting technology that might have made XML usable for
ordinary Web developers simply haven't happened, or haven't happened in
the right way. For example, in the beginning noone was thinking about
XSLT. You were supposed to be able to render XML with CSS stylesheets.
Actually, you can. But the fatal flaw in this scenario is that CSS has
no way to generate hyperlinks--so an XML document rendered with CSS can
look great and have all the visual features that an HTML page can have,
but it will not be hypertext. So what the hell good is that?

I can only speculate as to why nobody thought to add that feature to
CSS. I think they should have; that one change alone would make XML 
hugely more attractive. Yes, you can use XSLT, but it's a fairly hard
language to master. Maybe ordinary Web developers can learn to use it at
a very simple level, but anything that can be done at that level should
be possible with CSS--except for the hyperlink thing. And in order to
take advantage of the full power of XSLT, you need to understand some
fairly advanced concepts (knowing LISP/Scheme helps a lot).

Another thing that could have happened but didn't was to provide
"plug-and-play" access to the XML DOM through JavaScript. What if you
could load an XML document into the browser, and its DOM were just
there, the way the HTML DOM is? Of course, since XML has no predefined
element names, scripting would be more complex, but also immensely more
powerful. It could be a Web monkey's wet dream come true.

Now that I'm good and warmed up, I think I have to call "time."

> Is there a good site that would offer a good explanation and cut
> through the hype/cruft.  Many of the sites seem to say how XML is the
> greatest thing since the invention of the space bar, but none really
> say why.

Try this. It won't answer your question, but might help you explore the
issues (and probably encourage your healthy skepticism ;-):

    http://www.monasticxml.org/


 * If you've visited my Web site, you may have noticed that I do exactly
   that. But that's purely an exercise in self-promotion (showing off my
   XSLT skills), not my view of how sites in general should be built.
   BTW, since building my site with XML hasn't helped my career in any
   noticeable way, and since due to browser compatibility issues the
   most attractive view of the site can't be the default, I will be
   dropping that approach in the near future.

-- 
Matt Gushee                 When a nation follows the Way,
Englewood, Colorado, USA    Horses bear manure through
mgushee at havenrock.com           its fields;
http://www.havenrock.com/   When a nation ignores the Way,
                            Horses bear soldiers through
                                its streets.
                                
                            --Lao Tzu (Peter Merel, trans.)



More information about the clue-tech mailing list