{"id":13760355,"url":"https://github.com/eerohele/sigel","last_synced_at":"2025-05-02T10:30:27.627Z","repository":{"id":62433583,"uuid":"89168035","full_name":"eerohele/sigel","owner":"eerohele","description":"XSLT and XPath in your Clojure","archived":false,"fork":false,"pushed_at":"2024-01-17T09:37:38.000Z","size":179,"stargazers_count":29,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-07T00:51:15.368Z","etag":null,"topics":["clojure","saxon","xpath","xslt"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eerohele.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-23T19:47:39.000Z","updated_at":"2025-02-01T17:11:21.000Z","dependencies_parsed_at":"2024-01-15T03:46:39.215Z","dependency_job_id":"cb117cca-1c01-41e2-b87a-3c012abe5e05","html_url":"https://github.com/eerohele/sigel","commit_stats":{"total_commits":156,"total_committers":4,"mean_commits":39.0,"dds":0.6538461538461539,"last_synced_commit":"44910093e1ab0bbf3e9c208599e34464ba3e7ebf"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eerohele%2Fsigel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eerohele%2Fsigel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eerohele%2Fsigel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eerohele%2Fsigel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eerohele","download_url":"https://codeload.github.com/eerohele/sigel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252023096,"owners_count":21682132,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clojure","saxon","xpath","xslt"],"created_at":"2024-08-03T13:01:08.554Z","updated_at":"2025-05-02T10:30:27.379Z","avatar_url":"https://github.com/eerohele.png","language":"Clojure","funding_links":[],"categories":["Clojure"],"sub_categories":[],"readme":"Sigel\n=====\n\n[![Clojars Project](https://img.shields.io/clojars/v/me.flowthing/sigel.svg)](https://clojars.org/me.flowthing/sigel)\n\n( [Changelog] | **[API]** )\n\nSigel «ᛋ» is a Clojure interface to the XSLT and XPath bits of [Saxon].\n\n## XSLT\n\nSigel lets you write XSLT, but with parentheses instead of angle brackets.\n\n### Examples\n\n```clojure\n(require '[sigel.xslt.core :as xslt]\n         '[sigel.xslt.elements :as xsl])\n\n(def stylesheet-1\n  \"An XSLT stylesheet that converts \u003ca/\u003e to \u003cb/\u003e.\"\n  (xsl/stylesheet {:version 3.0}\n    (xsl/template {:match \"a\"} [:b])))\n\n(def stylesheet-2\n  \"An XSLT stylesheet that converts \u003cb/\u003e to \u003cc/\u003e.\"\n  (xsl/stylesheet {:version 3.0}\n    (xsl/template {:match \"b\"} [:c])))\n\n(def compiled-stylesheets\n  [(xslt/compile-sexp stylesheet-1) (xslt/compile-sexp stylesheet-2)])\n\n;; Transform the XML string \"\u003ca/\u003e\" with stylesheet-1 and then stylesheet-2.\n(xslt/transform compiled-stylesheets \"\u003ca/\u003e\")\n;;=\u003e #object[net.sf.saxon.s9api.XdmNode 0x61acfa00 \"\u003cc/\u003e\"]\n```\n\nYou can also write your transformation in EDN:\n\n```clojure\n;; a.edn\n[:xsl/stylesheet {:version 3.0}\n [:xsl/template {:match \"a\"} [:b]]]\n\n;; in your Clojure code\n(xslt/transform (xslt/compile-edn \"/path/to/a.edn\") \"\u003ca/\u003e\")\n;;=\u003e #object[net.sf.saxon.s9api.XdmNode 0xf2a49c4 \"\u003cb/\u003e\"]\n```\n\nYou can also execute XSLT transformations written in plain old XML:\n\n```xsl\n\u003c!-- a-to-b.xsl --\u003e\n\u003cxsl:stylesheet version=\"3.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"\u003e\n  \u003cxsl:template match=\"a\"\u003e\n    \u003cb/\u003e\n  \u003c/xsl:template\u003e\n\u003c/xsl:stylesheet\u003e\n```\n\n```clojure\n(xslt/transform (xslt/compile-xslt \"a-to-b.xsl\") \"\u003ca/\u003e\")\n;;=\u003e #object[net.sf.saxon.s9api.XdmNode 0x2bda7fdc \"\u003cb/\u003e\"]\n```\n\n## XPath\n\nSelect things in an XML document with XPath.\n\n### Examples\n\n```clojure\n(require '[sigel.xpath.core :as xpath])\n\n;; Select nodes with XPath.\n(seq (xpath/select \"\u003ca\u003e\u003cb/\u003e\u003cc/\u003e\u003c/a\u003e\" \"a/b | a/c\"))\n;;=\u003e\n;;(#object[net.sf.saxon.s9api.XdmNode 0x3cadbb6f \"\u003cb/\u003e\"]\n;; #object[net.sf.saxon.s9api.XdmNode 0x136b811a \"\u003cc/\u003e\"])\n\n;; Get the result of evaluating an XPath expression against a node as a Java\n;; object.\n(xpath/value-of \"\u003cnum\u003e1\u003c/num\u003e\" \"xs:int(num)\")\n;;=\u003e 1\n```\n\n## XML\n\nEvery function in this library that takes XML as input accepts any object that implements [the `XMLSource` protocol](https://github.com/eerohele/sigel/blob/master/src/sigel/protocols.clj).\n\n### Examples\n\n```clojure\n(require '[clojure.java.io :as io])\n\n;; java.lang.String\n(xpath/select \"\u003ca\u003e\u003cb/\u003e\u003cc/\u003e\u003c/a\u003e\" \"a/b\")\n;;=\u003e #object[net.sf.saxon.s9api.XdmNode 0x772300a6 \"\u003cb/\u003e\"]\n\n;; java.io.File\n(xpath/select (io/as-file \"/tmp/a.xml\") \"a/b\")\n;;=\u003e #object[net.sf.saxon.s9api.XdmNode 0x5487f8c7 \"\u003cb/\u003e\"]\n\n;; java.net.URL\n(xpath/select (io/as-url \"http://www.xmlfiles.com/examples/note.xml\") \"/note/to\")\n;;=\u003e #object[net.sf.saxon.s9api.XdmNode 0x79f4a8cb \"\u003cto\u003eTove\u003c/to\u003e\"]\n```\n\n## License\n\nCopyright © 2019 Eero Helenius\n\nDistributed under the [Eclipse Public License][EPL] either version 1.0 or (at\nyour option) any later version.\n\nSaxon is licensed under the [Mozilla Public License][MPL].\n\n[API]: https://cljdoc.xyz/d/me.flowthing/sigel/CURRENT\n[CHANGELOG]: https://github.com/eerohele/sigel/blob/master/CHANGELOG.md\n\n[EPL]: https://www.eclipse.org/legal/epl-v10.html\n[MPL]: https://www.mozilla.org/en-US/MPL\n[Saxon]: http://www.saxonica.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feerohele%2Fsigel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feerohele%2Fsigel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feerohele%2Fsigel/lists"}