[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2. What is it and how to use it?

Have you ever developed XML applications using XSLT? If so you probably felt the need of viewing the result of applying the XSLT processor on the XML file using an XSLT sheet you have been working on right inside your (X)Emacs, without having to go to a terminal or to the Web browser. This minor mode allows you to do it!

The XSLT-process minor mode allows you, while you're inside a buffer for which this minor mode is enabled, to enter a few keystrokes that will invoke the XSLT processor of choice on the buffer. The result is displayed in another (X)Emacs buffer, that allows you to quickly view and inspect the results.

The XSLT file that's used to process the file should be specified inside the XML file using the XML processing instruction `xml-stylesheet', like this:

<?xml-stylesheet href="URL/to/XSLT/file" type="text/xsl"?>

You can use any URI understood by your Java system, e.g. file, HTTP or FTP, to refer to a stylesheet. The XSLT engine will download the stylesheet from the remote location and make use of it locally. With the TrAX interface (see section 3.1 Supported XSLT processors), the stylesheet is cached in the processor, so further invocations of the XSLT processor won't process the stylesheet again, unless the stylesheet is modified.

You can use URLs which are relative to the location of your XML file. For example if you have an XSLT file `page-html.xsl' in the same directory as the XML file you can simply have inside the XML file the following processing instruction:

<?xml-stylesheet href="page-html.xsl" type="text/xsl"?>

The XSLT-process mode was designed to work with any XSLT processor written in the Java language. Support for processors written in programming languages other than Java may require some work.

Here is a screenshot of the XSLT-process mode in action.

[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by XEmacs Webmaster on October, 2 2007 using texi2html