ietf-xml-mime
[Top] [All Lists]

Re: Media types for XSL stylesheets

1999-10-11 18:57:39
You must be looking at an old WD.

The PR says: "The MIME media types text/xml and application/xml
[RFC2376] should be used for XSLT stylesheets. It is possible that a
media type will be registered specifically for XSLT stylesheets; if and
when it is, that media type may also be used."

The example in 2.7 uses text/xml.

2.3 also warns that: "In some situations, the only way that a system can
recognize that an XML document needs to be processed by an XSLT
processor as an XSLT stylesheet is by examining the XML document itself.
Using the simplified syntax makes this harder, and can even make it
impossible if the xsl:version attribute is omitted from the document
element. Therefore, the simplified syntax should not be used for XSLT
stylesheets that may be used in such a situation. This situation can,
for example, arise when an XSLT stylesheet is transmitted as a message
with a MIME media type of text/xml or application/xml to a recipient
that will use the MIME media type to determine how the message is
processed."

MURATA Makoto wrote:

XSL Transformations (XSLT) has become a proposed recommendation of W3C.
The URL is:
        http://www.w3.org/TR/xslt

An example in 2.7 "Embedding Stylesheets" uses "text/xsl".

        <?xml-stylesheet type="text/xsl" href="#style1"?>
        <!DOCTYPE doc SYSTEM "doc.dtd">
        <doc>
        <head>
        <xsl:stylesheet id="style1"
                xmlns:xsl="http://www.w3.org/XSL/Transform/1.0";
                xmlns:fo="http://www.w3.org/XSL/Format/1.0";>
        <xsl:import href="doc.xsl"/>
        <xsl:template match="id('foo')">
          <fo:block font-weight="bold"><xsl:apply-templates/></fo:block>
        </xsl:template>
        <xsl:template match="xsl:stylesheet">
          <!-- ignore -->
        </xsl:template>
        </xsl:stylesheet>
        </head>
        <body>
        <para id="foo">
        ...
        </para>
        </body>
        </doc>

However, there is a note as below:

        NOTE: The text/xsl media type has not been registered. No decision
        has been made on whether a media type other than text/xml or
        application/xml will be used for XSLT and XSL.

Here is some background information about this issue.

1) At present, AFAIK, XSL is the only stylesheet in the XML syntax.  But this
may change at any time.

2) An XSL stylesheet does not always begin with the XSL namespace.  If it
is written in the simplified syntax shown in "2.3 Literal Result Element as
Stylesheet" of XSLT, it can begin with any namespace.

3) An XSL stylesheet may be embedded as a part of XML document itself and
is referenced by a fragment identifier from this XML document.  The above
example demonstrates such an embedded XSL stylesheet.

4) The combination of 3) and 4) means that an embedded stylesheet may
be in the simplified syntax, and can begin with any namespace.

5) The example quoted above is controvertial.  If this document is delivered
as "text/xml", what will be the media type for the referenced (embedded)
XSL stylesheet?  text/xml or text/xsl?

Makoto

Fuji Xerox Information Systems

Tel: +81-44-812-7230   Fax: +81-44-812-7231
E-mail: murata(_dot_)makoto(_at_)fujixerox(_dot_)co(_dot_)jp