;;;; xslide-process.el --- Process an XSL stylesheet ;; $Id: xslide-process.el,v 1.3 2003/06/05 22:13:01 tonygraham Exp $ ;; Copyright (C) 1998, 1999, 2000, 2001 Tony Graham ;; Author: Tony Graham ;;; This file is not part of GNU Emacs. ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License ;; as published by the Free Software Foundation; either version 2 ;; of the License, or (at your option) any later version. ;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ;;;; Commentary: ;; Originally copied almost wholesale from psgml.el by Lennart Staflin ;; Send bugs to xslide-bug@menteith.com ;; Use `xsl-submit-bug-report' for bug reports ;;;; Variables: (defcustom xsl-offer-save t "*If non-nil, ask about saving modified buffers before \\[xsl-process] is run." :type '(choice (const :tag "Yes" t) (const :tag "No" nil)) :group 'xsl-process) (defcustom xsl-process-browse-output nil "*If non-nil, open output in browser after \\[xsl-process] is run." :type '(choice (const :tag "Yes" t) (const :tag "No" nil)) :group 'xsl-process) (defcustom xsl-process-find-output nil "*If non-nil, find output file after \\[xsl-process] is run." :type '(choice (const :tag "Yes" t) (const :tag "No" nil)) :group 'xsl-process) (defcustom xsl-process-command (list ;; XT Windows executable "xt %i %s %o" ;; XT Java "java com.jclark.xsl.Driver %i %s %o" ;; Xalan-Java 2 "java org.apache.xalan.xslt.Process -IN %i -XSL %s -OUT %o" ;; Instant Saxon "saxon -o %o %i %s" ;; Instant Saxon using xml-stylesheet PI "saxon -o %o %i" ;; Saxon "java com.icl.saxon.StyleSheet -o %o %i %s" ;; Saxon using xml-stylesheet PI "java com.icl.saxon.StyleSheet -o %o %i" ;; xsltproc "xsltproc -o %o %s %i" ;; jd.xslt "java jd.xml.xslt.Stylesheet -out %o %i %s" ;; Oracle XDK for Java "java oracle.xml.parser.v2.oraxsl %i %s %o" ) "*The shell command to process an XSL document. This is a `format' control string that by default should contain three `%s' conversion specifications: the first will be replaced by the value of `xsl-process-input-file' \(or the empty string, if nil\); the second will be replaced by `xsl-process-stylesheet-file' \(or the empty string, if nil\); the third will be replaced by `xsl-process-output-file' \(or the empty string, if nil\). If `xsl-process-files' is non-nil, the format string should contain one `%s' conversion specification for each element of its result. If `xsl-process-command' is a list, then every element should be a string. The strings will be tried in order and %-sequences in the string will be replaced according to the list below, if the string contains %-sequences with no replacement value the next string will be tried. %b means the visited file of the current buffer %i means the value of `xsl-process-input-file' %s means the value of `xsl-process-stylesheet-file' %o means the value of `xsl-process-output-file' " :type '(repeat :tag "Commands" string) :group 'xsl-process) (defvar xsl-process-files nil "If non-nil, a function of no arguments that returns a list of file names. These file names will serve as the arguments to the `xsl-process-command' format control string instead of the defaults.") (defcustom xsl-process-error-regexps '( ;; Xalan-Java 2 ;; file:///path/to/foo.xsl; Line 9; Column 12; ... ("^file:\\([^;]+\\)\\; Line \\([0-9]+\\)\\;\\( Column \\([0-9]+\\)\\;\\)?" 1 2 4) ;; Saxon ;; Error at xsl:output on line 9 of file:/path/to/foo.xsl: ;; Error on line 9 column 5 of file:/path/to/foo.xsl: ("^Error\\( at [^ ]+\\)? on line \\([0-9]+\\)\\( column \\([0-9]+\\)\\)? of file:\\(\\(/[A-Za-z]:\\)?[^:]+\\):$" 5 2 4) ;; Oracle ;; file:/path/to/foo.xsl: ... ("^file:\\([^<]+\\):" 1 2 4) ;; jd.xslt ;; - uri = file:/path/to/foo.xsl ;; - line = 9 ;; - column = -1 ;; ...or... ;; - uri = file:/path/to/foo.xsl ;; - element = xsl:output (line 9) ("^- uri[ \t]+= file:\\(.+\\)\\([\r\n+]- \\(\\([^(]*?(\\)?line[ \t]+\\(= \\)?\\([0-9]+\\)\\)?\\)?\\([\r\n]+- column[ \t]+= \\([0-9]+\\)\\)?" 1 6 8) ;; Generic (".*\\