[xsl] xml-stylesheet p.i. and other options (was Re: text/xsl...)

Subject: [xsl] xml-stylesheet p.i. and other options (was Re: text/xsl...)
From: Mike Brown <mike@xxxxxxxx>
Date: Sun, 23 Jun 2002 12:24:59 -0600 (MDT)
I wrote:
> >Of course, the whole notion of hard-coding a stylesheet reference in an XML
> >document is a source of controversy. It is almost exclusively used to let a
> >browser load a data source directly through a standard HTTP GET and to force
> >a particular rendering of that data. This is a problem that could have been,
> >and has been, solved in other, arguably more intelligent ways.

Wendell Piez wrote:
> Right now the only techniques I know of to get this behavior is to go
> through MS-proprietary scripting or do it all server side. There appears to
> be no standard for doing it in a non-proprietary way on the client. But
> it's a pretty core infrastructure requirement. I suppose the good wizards
> could invent one. Could use RDDL or some such I suppose.
>
> Mike, could you offer a brief synopsis of other ways?

I think you're on the mark with RDDL(-ish), although I'm no fan of how RDDL
came into existence (overengineering on xml-dev to address what is essentially
a non-problem), and I am not ashamed to admit that I've never used it, myself.
:)

What is troublesome, to me, is that when armed with the xml-stylesheet hammer,
people see every variation of XML-plus-XSLT-over-the-web as a nail.
Applications are being designed in a particular way, just to create the fairly
narrow set of circumstances where <?xml-stylesheet?> can be used.

I don't mean to say that <?xml-stylesheet?> doesn't have its advantages, not
the least of which is the notion that it helps encourage the rapid adoption of
XML on the web by empowering document authors. I also don't mean to insult the
many developers who have been wise enough to avoid the p.i. when it was
impractical. I'm just saying that what we typically use XSLT for makes certain
application design patterns and abstractions more sensible than others, and
<?xml-stylesheet?> tends to be one of the less sensible solutions.

I won't go into a thorough explanation here, but suffice it to say that if you
pretend the p.i. doesn't exist, and you think about what would be a good way
to Separate Data From Presentation, the last thing you'd probably want is for
the two to be inextricably linked, as you might as well have just hard-coded
the whole thing in HTML; all you achieved was separation through obfuscation,
and you made a bunch of assumptions along the way about how your data is
requested and processed, and about the knowledge of which stylesheet is
appropriate.

The most basic questions that were never asked include "for whom is this XML
appropriate? why/how do I need to reinterpret it? how do I know what kind of
reinterpretation is necessary? what kind of information infrastructure is
imposed by the client/server framework under which I must operate (HTTP
user-agents, for example)? what are the limitations and capabilities of the
target audience, the processors of the data?"

Anyway, until something RDDL-like is available, we are stuck with the
server-side solutions, and solutions that offload some of the traditonally
server-side decisions onto the client via scripting (which I don't see as
being any better because you've made a bunch more assumptions about the
capabilities of the client). I know you asked me to enumerate the options, but
I feel like I'm unable to do so briefly; I keep wanting to give a very
thorough explanation of the rationale and little decisions that need to be
made along the way. I don't want to hold people's hands, yet I do want to ...
argh. :)

I don't know, I just think it's one of those things that you either "get" or
you don't, and maybe if it's easier to call it a nail and pound it with
<?xml-stylesheet?>, then more power to ya. It's not really worth fighting
about.

And I'm fully willing to admit that while I think I "get" it, perhaps I don't,
really, and I'd be happy to be proven wrong. I can admit right now that my
experience with technologies like SSI, CGI, Cold Fusion, PHP, server-side
XSLT, WebLogic and 4Suite, and cursory research into Zope, ASP, MSXML, and a
couple others, have coloured/tainted my views, and perhaps someone has already
come up with a solution that beats them all and I just haven't heard about it.

   - Mike
____________________________________________________________________________
  mike j. brown                   |  xml/xslt: http://skew.org/xml/
  denver/boulder, colorado, usa   |  resume: http://skew.org/~mike/resume/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread