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
import net.sf.saxon.lib.FeatureKeys; | |
import net.sf.saxon.s9api.Processor; | |
import net.sf.saxon.s9api.SaxonApiException; | |
import net.sf.saxon.s9api.XsltCompiler; | |
import net.sf.saxon.s9api.XsltExecutable; | |
import org.springframework.stereotype.Service; | |
import javax.xml.transform.stream.StreamSource; | |
import java.io.IOException; |
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
import net.sf.saxon.Configuration; | |
import net.sf.saxon.expr.XPathContext; | |
import net.sf.saxon.expr.sort.CodepointCollator; | |
import net.sf.saxon.expr.sort.GenericAtomicComparer; | |
import net.sf.saxon.functions.DeepEqual; | |
import net.sf.saxon.lib.UnfailingErrorListener; | |
import net.sf.saxon.s9api.Processor; | |
import net.sf.saxon.s9api.XdmNode; | |
import net.sf.saxon.trans.XPathException; |
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
import net.sf.saxon.s9api.*; | |
import javax.xml.transform.stream.StreamSource; | |
import java.io.StringReader; | |
public class Main { | |
public static void main(String[] args) throws SaxonApiException { | |
String bookXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + | |
"<books>\n" + | |
" <book category=\"reference\">\n" + | |
" <author>Nigel Rees</author>\n" + |
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
<xsl:stylesheet version="1.0" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:param name="xPathToContent"/> | |
<xsl:template match="/"> | |
<ol> | |
<!-- altova has an equivalent 'altova:evaluate' --> | |
<xsl:for-each select="saxon:evaluate($xPathThing)" xmlns:saxon="http://saxon.sf.net/"> | |
<xsl:apply-templates/> | |
</xsl:for-each> |
This code was written to validate a very simple map of the structure of {:body {:grepString "grepp" :date "2014-05-03" :environment "nightly"}
This snippet is not idiomatic clojure.
(defn validate-request [req]
(let [json-vals (:body req)
grepStr (:grepString json-vals)
date (:date json-vals)
env (:environment json-vals)
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
(defn parse [src-to-parse] | |
(-> src-to-parse | |
(html/html-resource ) | |
(html/select-nodes* #{[:body :form :div (html/attr= :id "qautil-display" ) html/text-node ]}) | |
) | |
) |
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
Babysitter Kata | |
Background | |
---------- | |
This kata simulates a babysitter working and getting paid for one night. The rules are pretty straight forward: | |
The babysitter | |
- starts no earlier than 5:00PM | |
- leaves no later than 4:00AM | |
- gets paid $12/hour from start-time to bedtime |
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
(clojure.contrib.str-utils/str-join "\n" (loop [s1 '((1 2 3) (4 5 6)) result '()] | |
(if (empty? s1) | |
result | |
(recur (rest s1) (conj result (clojure.contrib.str-utils/str-join "\t" (first s1))))))) |
NewerOlder