[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Media types for XSL stylesheets



MURATA Makoto wrote:

> I read your mail and the XSL PR.  I think that the PR has done a very good
> job, since it uses text/xml and application/xml and still keeps the door
> open for XSL-specialized media types.

I think eventually it would be desirable to have an XSL-specialized
media type and now seems like a good time to start a discussion of this.

First, a bit more background to supplement what you have already given.

1. There are two specs involved here, XSLT and XSL.  XSLT, which has
just become a PR, is a language expressed in XML for transforming XML
documents.  XSL, which is currently a WD, defines an XML language for
specifying formatting (at a semantic level similar to RTF rather than
PDF); this language is usually called XSL FO (Formatting Objects).  An
XSL stylesheet is an XSLT stylesheet that transforms into XSL FOs. XSL
is thus the combination of XSLT and XSL FO. XSL FO is not a separate
spec.

2. XSLT is not restricted to transform into XML.  Although it always
conceptually produces an XML tree, than XML tree need not be serialized
as XML.  It can be serialized as HTML or as plain text.  XSLT allows
stylesheets to declare the media type of the result.  You can have XSLT
stylesheets that transform into VRML or SVG.  A browser could launch the
appropriate viewer based on the declared result media type.

3. XSL FOs can potentially be mixed with other XML vocabularies such as
SVG.

I suspect a specialized media type for XSLT is needed, since

- it's not always possible to tell that an XML document is an XSLT
stylesheet; for example,

  <doc/>

is a legal XSLT stylesheet (whose semantics are to transform any XSLT
document to an XML document containing just a single empty "doc"
element); thus even if there was a way with application/xml to indicate
the namespace URIs used, this would not be enough for content
negotiation to work

- it would be useful for the media type for XSLT to have a parameter
that declared the media type of the result of a transformation; in order
for a browser to be able to use an XSLT stylesheet to display a
document, it needs not just to be able to handle XSLT but also to be
able to handle the result of the XSLT process; this seems specific to
XSLT

I don't think there needs to be a specific media type for XSL. XSL
should be handled as an instance of the XSLT media type.  

I'm not sure about XSL FOs. One way to deal with them would be as an
instance of application/xml with a parameter indicating the namespace
URIs used, but that would make the media type of an XSL stylesheet
something like

application/xslt; result="application/xml;
namespace-uris=\"http://www.w3.org/1999/XSL/Format\"";

which is a bit unwieldy.

James