Everytime I need this functionality, I endup spending atleast 10 minutes fumbling with the SAXON documentation to get the right command. I guess, I would do myself a service by having it as a weblog entry.
Assume that you have an XML file with appropriate xml-stylesheet PI and stylesheet to convert it into an XHTML document. The input document would look like:
inpfile.xml
=======
<?xml version="1.0" encoding="us-ascii"?>
<!DOCTYPE spec PUBLIC "-//W3C//DTD Specification V2.2//EN" "xmlspec.dtd">
<?xml-stylesheet type='text/xsl' href='ws-spec.xsl' ?>
... Rest of the document ...
You can get the transofrmed document by issuing the command:
c:\>java -jar %SAXONDIR%\saxon.jar -a inpfile.xml > outfile.html
Here env. var. SAXONDIR points to the installation directory of SAXON (ex: c:\saxon-6.5.2)