Created
December 7, 2012 03:39
-
-
Save ponkore/4230570 to your computer and use it in GitHub Desktop.
Google Common Lisp Style Guide の XML ファイルを HTML ファイルに XSLT を使って変換する。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; | |
;;; 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