From: Dave P. <dav...@gm...> - 2005-12-09 13:04:54
|
Tested with and without the xml decl in the file. Defaults to 1.0 (if missing too) I'll try and use this to load either a 1.0 or 2.0 'empty' stylesheet, then set the current variables to a list of either 1.0 or 2.0 elements and attributes. (defvar xsl-ver 1.0) =09 (defun fv() "Find the xslt version" (interactive) (save-excursion (goto-char (point-min)) (skip-chars-forward "\\s-") (cond ((looking-at "<\\?xml");; 2nd time if xmldcl present (setq p (re-search-forward "version=3D\"" nil t 2)) (buffer-substring-no-properties p (+ p 3))) (t (setq p (re-search-forward "version=3D\"" nil t 1)) (buffer-substring-no-properties p (+ p 3))) ) ) ) (setq xsl-ver (if (fv) (fv) 1.0 )) regards -- Dave Pawson XSLT XSL-FO FAQ. http://www.dpawson.co.uk |