Created
November 20, 2014 15:21
-
-
Save eerohele/5d8c75697cf8b7f253c5 to your computer and use it in GitHub Desktop.
An example of parsing a DITA file with clojure-saxon
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
(ns dita | |
(:require [saxon :as xml]) | |
(:import (net.sf.saxon.trans XmlCatalogResolver))) | |
(def xmldoc (slurp "/path/to/ditamap")) | |
(. net.sf.saxon.trans.XmlCatalogResolver | |
(setCatalog "/path/to/dita-ot/src/main/catalog-dita.xml" (.getUnderlyingConfiguration xml/proc) true)) | |
(def xdmnode (xml/compile-xml xmldoc)) | |
(def hrefs (xml/query "//*[contains(@class, ' map/topicref ')]/@href" xdmnode)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment