A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Jump to

Quick reference

Setting up xemacs xslt-process mode

I set all these options in the environment:

#########################
# copied from /etc/java/java.conf
# JPackage Project
#########################
# Location of jar files on the system
export JAVA_LIBDIR=/usr/share/java
# Location of arch-specific jar files on the system
export JNI_LIBDIR=/usr/lib/java
# List of known java homes (used for autodetection if none is provided)
export JAVA_HOME_LIST=$JAVA_LIBDIR-utils/java_home.list
# Root of all JVM installations
export JVM_ROOT=/usr/lib/jvm
# Default jvm
export JAVA_HOME=$JVM_ROOT/java
# Options to pass to the java interpreter
export JAVACMD_OPTS=
#########################


export CLASSPATH=/usr/share/java

Now when I try to run xslt-process, it says:
Starting the BeanShell. Please wait...

...but then straight away it still always says:
Could not process file, most probably (Xalan1|Saxon) could not be found!

What I think is happening:
  • xalan-2.4.1.jar is installed, not xalan1 as is required.
  • Not all of saxon's dependencies are installed.

Installing an XSLT processor

xsltproc, Saxon or Xalan: http://www.sagehill.net/docbookxsl/InstallingAProcessor.html

Installing Saxon on Linux. Is JAXP 1.3 required? And then how would I test it anyway?

Could install Xalan. But it's already included with Java:
java org.apache.xalan.xslt.EnvironmentCheck

Why can't xemacs' xlst-process mode find any xslt processor?

Simple XSL test

xml.xml file:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="xsl.xsl"?>
<hello-world>
<greeter>An XSLT Programmer</greeter>
<greeting>Hello, World!</greeting>
</hello-world>

xsl.xsl file:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/hello-world">
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<H1>
<xsl:value-of select="greeting"/>
</H1>
<xsl:apply-templates select="greeter"/>
</BODY>
</HTML>
</xsl:template>
<xsl:template match="greeter">
<DIV>from <I><xsl:value-of select="."/></I></DIV>
</xsl:template>
</xsl:stylesheet>

Working with xemacs XSLT-process mode

M-x xslt-process-mode - enable xslt-process mode
C-c C-x v - run the xslt processor and view results (be sure to type slowly enough!)

M-x customize-group RET xslt-process - options menu: change engine, customise key bindings, etc.

NOTE: the default run command above may have problems under cygwin. Redefine it to C-x C-c C-v and it should work.

xemacs buffer control

C-x b [buffer] [enter] - select or create a named buffer
C-x C-b - list existing buffers
C-x 1 - close the buffer list