0eb9edfc45
Closes #31499. Signed-off-by: Jan Viljanen <527069+javian@users.noreply.github.com>
38 lines
1 KiB
Ruby
38 lines
1 KiB
Ruby
class Saxon < Formula
|
|
desc "XSLT and XQuery processor"
|
|
homepage "https://saxon.sourceforge.io"
|
|
url "https://downloads.sourceforge.net/project/saxon/Saxon-HE/9.8/SaxonHE9-8-0-14J.zip"
|
|
version "9.8.0.14"
|
|
sha256 "139644e35aed79f16218848cd5e6c00f70c54378b3821e6d6ac723d8b84a4287"
|
|
|
|
bottle :unneeded
|
|
|
|
def install
|
|
libexec.install Dir["*.jar", "doc", "notices"]
|
|
bin.write_jar_script libexec/"saxon9he.jar", "saxon"
|
|
end
|
|
|
|
test do
|
|
(testpath/"test.xml").write <<~EOS
|
|
<test>It works!</test>
|
|
EOS
|
|
(testpath/"test.xsl").write <<~EOS
|
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
|
|
<xsl:template match="/">
|
|
<html>
|
|
<body>
|
|
<p><xsl:value-of select="test"/></p>
|
|
</body>
|
|
</html>
|
|
</xsl:template>
|
|
</xsl:stylesheet>
|
|
EOS
|
|
assert_equal <<~EOS.chop, shell_output("#{bin}/saxon test.xml test.xsl")
|
|
<html>
|
|
<body>
|
|
<p>It works!</p>
|
|
</body>
|
|
</html>
|
|
EOS
|
|
end
|
|
end
|