Skip to content

Instantly share code, notes, and snippets.

@ponkore
Created December 7, 2012 03:39
Show Gist options
  • Save ponkore/4230570 to your computer and use it in GitHub Desktop.
Save ponkore/4230570 to your computer and use it in GitHub Desktop.
Google Common Lisp Style Guide の XML ファイルを HTML ファイルに XSLT を使って変換する。
;;;
;;; see http://mail2.nara-edu.ac.jp/~asait/java/xml/xml.htm#section4
;;;
(ns lispguide-convert
(:import
[javax.xml.transform TransformerFactory]
[javax.xml.transform.stream StreamSource StreamResult]))
(defn doit
([] (doit "lispguide.html" "lispguide.xml" "styleguide.xsl"))
([outfile xmlfile xslfile]
(let [factory (TransformerFactory/newInstance)
xslt (. factory newTransformer (StreamSource. xslfile))]
(. xslt transform
(StreamSource. xmlfile)
(StreamResult. outfile)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment