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
// README: | |
// | |
// Save this file and settings.gradle into a directory. Then: | |
// | |
// $ gradle | |
// $ gradle jar | |
// $ java -cp build/libs/saxon9he.jar net.sf.saxon.Transform <options> | |
import org.gradle.api.tasks.Copy |
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 clj-xslt | |
(:require [clojure.data.xml :as xml]) | |
(:import (java.time LocalDateTime) | |
(java.time.format DateTimeFormatter) | |
(java.io StringBufferInputStream StringWriter StringReader) | |
(javax.xml.transform.stream StreamSource) | |
(net.sf.saxon.s9api XsltCompiler Processor) | |
(net.sf.saxon Configuration))) | |
(def processor |
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 ^:no-doc clojutron.examples.pain-mdr | |
(:require [clojure.java.io :as io] | |
[clojure.data.zip.xml :refer [xml1-> attr text]] | |
[clojutron.schema :refer :all] | |
[clojure.edn :as edn]) | |
(:refer-clojure :exclude [assert]) | |
(:import (org.iban4j BicUtil IbanUtil))) | |
(def iso4217-currency-codes | |
"Read the set of valid ISO 4217 currency codes from an EDN file." |
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
:root { | |
--baseline: 1.5rem; | |
--background-color: #090415; | |
--text-color-default: #F9EEF9; | |
--text-color-code: #F9EEF9; | |
--color-emphasis-dark: #1B0C40; | |
--font-sans-serif: "Fira Sans", Helvetica, sans-serif; | |
--font-monospace: "Fira Mono", monospace; | |
} |
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
let namespaces = | |
Some [("p", "urn:iso:std:iso:20022:tech:xsd:pain.001.001.03")] | |
let pain03 = | |
schema namespaces [ | |
pattern "Group header" [ | |
rule "p:Document/p:CstmrCdtTrfInitn" [ | |
assert' "<NbOfTxs> is equal to the number of individual transactions contained in the message." | |
"xs:integer(p:GrpHdr/p:NbOfTxs) eq xs:integer(count(p:PmtInf/p:CdtTrfTxInf))" |
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
Param( | |
[Parameter(Mandatory = $True)] [string] $Path, | |
[Parameter(Mandatory = $True)] [string] $Xsl, | |
[Parameter(Mandatory = $False)] [string] $Filter = "*.xml", | |
[Parameter(Mandatory = $False)] [string] $Target = (Join-Path (Convert-Path .) "target"), | |
[Parameter(Mandatory = $False)] [hashtable] $Params | |
) | |
Set-StrictMode -version 2.0 |
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
open XSLTUnit | |
[<TestFixture>] | |
type ``Testing XSLT with F#``() = | |
inherit XSLTUnit(Uri(@"C:\TEMP\test.xsl")) | |
[<Test>] | |
member xsl.``Applying a template with a tunnel template parameter in the default mode``() = | |
xsl.Apply("""<input attribute="1"/>""", parameters = parameters Template true [(QName("number"), 42)]) | |
|> should produce """<output attribute="42"/>""" |
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 org.specs2._ | |
import com.github.eerohele.expek.XsltSpecification | |
import net.sf.saxon.s9api.XdmNode | |
import scala.xml.{Elem, Node, XML} | |
class Html5TableSpecification extends mutable.Specification with XsltSpecification { | |
import com.github.eerohele.expek.NodeConversions._ |
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
class MySpecification extends XsltSpecification(new File("src/test/resources/stylesheets/test.xsl")) { | |
"Simple transformation" >> { | |
applying(<paragraph>foo</paragraph>) yields(<p>foo</p>) | |
} | |
"Set mode and parameters" >> { | |
applying(<paragraph>foo</paragraph>) | |
.withMode("main") | |
.withParameters(tunnel = false)("foo" -> "bar", "baz" -> "quux") | |
.yields(<p>bar, quux</p>) |
This file has been truncated, but you can view the full file.
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
Adding reference: ant.PropertyHelper | |
Detected Java version: 1.8 in: /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre | |
Detected OS: Mac OS X | |
Adding reference: ant.ComponentHelper | |
Setting ro project property: dita.output.dir -> /tmp/out | |
Setting ro project property: args.input -> /Users/eerohele/Public/dita-test/dita-1.2-specification/dita-1.2-specification.ditamap | |
Setting ro project property: transtype -> html5 | |
Setting ro project property: ant.file -> /Users/eerohele/Git/dita-ot/src/main/build.xml | |
Setting ro project property: ant.file.type -> file | |
Adding reference: ant.projectHelper |