W3C home > Mailing lists > Public > xsl-editors@w3.org > April to June 1999

Suggested additions to XSLT Section 6.2.8 System Functions

From: Paul Fidler <praf1@cam.ac.uk>
Date: Wed, 28 Apr 1999 16:05:10 +0100 (BST)
To: xsl-editors@w3.org
Message-ID: <Pine.HPP.3.96L.990428145959.7596B-100000@punch.eng.cam.ac.uk>
XSL Editors,

I've been thinking about the following (which appeared on the xsl-list)
and have come up with a few suggestions which I hope may be useful:-

  "... The proper use of XSL is to determine the user's desired media and
   limitations then produce the appropriate document for that user. (The
   key is "determine the user's desired media and limitations", not
   whether that transformation occurs on a server or on a client.)"

                                       Stephen Deach (personal opinion)

Section 6.2.8 (System Functions) of the 21st April draft allows  
stylesheets to get information about system environment variables using
system-property(), and availability of functions using 

At present the system-property() function can be used to get at one
well-known xsl property (xsl:version) and any environment variables. For a
stylesheet being run on a server via a cgi script, this  may well be
useful in determining whether or not to create formatting objects linked
to certain types of images:

  eg. system-property("HTTP_ACCEPT")

   would return a string containing a comma separated list
   of acceptable mime types.

The HTTP_* environment variables available to cgi scripts are all well
known and well understood.

There are disadvantages to this approach however (tailoring output to the
connecting browser), not least that it is not friendly to caching proxy

When run on a browser, a stylesheet should be able to get information on
acceptable media types, user preferences, helper applications etc. and
generate a rendering using formatting objects appropriate to the browser -
using the same XML source (ie. caching friendly). 

However, when run as part of a browser, there are no well know environment
variables for the stylesheet to query - so I would like to suggest some
extra (optional) system properties/functions: 


    These would indicate whether a particular media type
    is embeddable within the browser and/or viewable
    with a helper application.

    eg. an xsl enabled lynx might return false for
        xsl:image-embeddable("image/gif"), but true
        for xsl:helper-available("image/gif") if the
        user has xv installed on the system.


    returns "screen", "print", "aural", "tty", "hologram" etc.
    (see http://www.w3.org/TR/REC-html40/types.html#h-6.13)
    or returns "" if the xsl processor is unaware of the media
    it is being invoked to produce a rendering for.

Some browsers are perfectly capable of displaying certain media types, but
the user has the option of turning whole classes of them off. This isn't
really handled well by 'media'.


    return either "on", "off", or "" if the string wasn't


    would return information about what sort of xsl
    implementation the stylesheet is running on.

    Returns "server", "browser", "stand-alone" or ""

None of these need necessarily be specified in the XSL recommendation,
since I'm sure that XSL processors in browsers will be be able to use
javascript to do similar things via the <xsl:functions> element and
various vendor specific objects (navigator.mimeTypes[]) etc.

However, I don't think it should be necessary to use javascript just to
allow a stylesheet to decide whether it is going spit out an
<fo:inline-image> with a short description, or an <fo:inline-link> to an
image and a long description. It should definitely be possible to do it in
a standard way that can degrade gracefully when not available.

To this end I think that these functions/properties (or others with
equivalent or better functionality) should be specified in the eventual 
XSL recommendation, so that there is a standard way to get at this sort of

An XSL processor could always return false for:
  function-available("xsl:helper-available") and
and can return "" for:
  system-property("xsl:media") and
if it didn't support these (or some of these) optional extras or if it.

Anyway, that's it. If you read this far - many thanks! I hope you found it
useful and sensible.

Best wishes,

Paul Fidler
Cambridge University Engineering Department
Trumpington Street, Cambridge, CB2 1PZ, UK
Received on Wednesday, 28 April 1999 11:05:16 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:44:16 UTC