{"id":29097390,"url":"https://github.com/lambdaisland/xml-select","last_synced_at":"2025-06-28T13:42:10.585Z","repository":{"id":254400677,"uuid":"846426106","full_name":"lambdaisland/xml-select","owner":"lambdaisland","description":"XPath-style selectors for Clojure","archived":false,"fork":false,"pushed_at":"2024-09-05T06:27:45.000Z","size":22,"stargazers_count":15,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-05-31T06:01:46.803Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lambdaisland.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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":"2024-08-23T07:20:55.000Z","updated_at":"2025-04-30T03:58:13.000Z","dependencies_parsed_at":"2024-08-23T08:27:04.802Z","dependency_job_id":"2e67708b-c869-4bb1-b733-d8acd11c5174","html_url":"https://github.com/lambdaisland/xml-select","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"821af4778938bc47aca3eb0e04f3fa58a54ce8c8"},"previous_names":["lambdaisland/xml-select"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdaisland%2Fxml-select","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdaisland%2Fxml-select/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdaisland%2Fxml-select/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdaisland%2Fxml-select/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lambdaisland","download_url":"https://codeload.github.com/lambdaisland/xml-select/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lambdaisland%2Fxml-select/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259090978,"owners_count":22803777,"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":[],"created_at":"2025-06-28T13:42:06.492Z","updated_at":"2025-06-28T13:42:10.577Z","avatar_url":"https://github.com/lambdaisland.png","language":"Clojure","funding_links":["https://opencollective.com/lambda-island","http://opencollective.com/lambda-island"],"categories":[],"sub_categories":[],"readme":"# lambdaisland/xml-select\n\n\u003c!-- badges --\u003e\n[![cljdoc badge](https://cljdoc.org/badge/com.lambdaisland/xml-select)](https://cljdoc.org/d/com.lambdaisland/xml-select) [![Clojars Project](https://img.shields.io/clojars/v/com.lambdaisland/xml-select.svg)](https://clojars.org/com.lambdaisland/xml-select)\n\u003c!-- /badges --\u003e\n\nXPath-style selectors in Clojure\n\nA single `select` function to conveniently search in `clojure.data.xml` style\ndata structures.\n\n## Features\n\n```clj\n(require '[lambdaisland.xml-select :as xs])\n\n(def doc\n  {:tag :Movies\n   :content\n   [{:tag :Movie\n     :attrs {:rating \"R\"}\n     :content\n     [{:tag :Title :attrs {:runtime \"177\"} :content [\"The Godfather\"]}\n      {:tag :Genre :content [\"Crime Drama\"]}\n      {:tag :Director\n       :content\n       [{:tag :Name\n         :content\n         [{:tag :First :content [\"Francis Ford\"]}\n          {:tag :Last :content [\"Coppola\"]}]}]}\n      {:tag :Studio :content [\"Paramount Pictures\"]}\n      {:tag :Year :content [\"1972\"]}]}\n    {:tag :Movie\n     :attrs {:rating \"R\"}\n     :content\n     [{:tag :Title\n       :attrs {:runtime \"142\"}\n       :content [\"The Shwashank Redemption\"]}\n      {:tag :Genre :content [\"Drama\"]}\n      {:tag :Director\n       :content\n       [{:tag :Name\n         :attrs {:highratedmovie \"The Mist\"}\n         :content\n         [{:tag :First :content [\"Frank\"]}\n          {:tag :Last :content [\"Darabont\"]}]}]}\n      {:tag :Studio :content [\"Columbia Pictures\"]}\n      {:tag :Year :content [\"1994\"]}]}]})\n\n;; Select by tag\n(xs/select [:Year] doc)\n;; =\u003e ({:tag :Year, :content [\"1972\"]} {:tag :Year, :content [\"1994\"]})\n\n;; Descendants\n(xs/select [:Movies :Title] doc)\n;; =\u003e ({:tag :Title, :attrs {:runtime \"177\"}, :content [\"The Godfather\"]}\n;;     {:tag :Title, :attrs {:runtime \"142\"}, :content [\"The Shwashank Redemption\"]})\n\n\n;; Direct Descendant\n(xs/select [:Movie :\u003e :Title] doc)\n\n;; Arbitary function\n(xs/select [:Movies :\u003e #(= {:rating \"R\"} (:attrs %))] doc)\n\n;; Attribute\n(xs/select [{:runtime \"142\"}] doc)\n;; =\u003e ({:tag :Title, :attrs {:runtime \"142\"}, :content [\"The Shwashank Redemption\"]})\n\n;; Can take a regex\n(xs/select [{:runtime #\"\\d{3}\"}] doc)\n;; =\u003e ({:tag :Title, :attrs {:runtime \"177\"}, :content [\"The Godfather\"]}\n;;     {:tag :Title, :attrs {:runtime \"142\"}, :content [\"The Shwashank Redemption\"]})\n\n;; Can take a function\n(xs/select [{:runtime #(\u003c 150 (parse-long %) 180)}] doc)\n;; =\u003e ({:tag :Title, :attrs {:runtime \"177\"}, :content [\"The Godfather\"]})\n\n;; Vector to combine multiple predicates\n(xs/select [:Movie [:Title {:runtime \"177\"}]] doc)\n;; =\u003e ({:tag :Title, :attrs {:runtime \"177\"}, :content [\"The Godfather\"]})\n\n;; String matches a text node, or the combined string value of all descendant text nodes \n(xs/select [\"Coppola\"] doc)\n;; =\u003e ({:tag :Last, :content [\"Coppola\"]} \"Coppola\")\n\n\n;; Compose to have \"having\" semantics, e.g. the year of all movies with genre \"Crime drama\"\n(xs/select [:Movies :\u003e #(xs/select [:Genre \"Crime Drama\"] %) :Year] doc)\n;; =\u003e ({:tag :Year, :content [\"1972\"]})\n```\n\n\u003c!-- installation --\u003e\n## Installation\n\nTo use the latest release, add the following to your `deps.edn` ([Clojure CLI](https://clojure.org/guides/deps_and_cli))\n\n```\ncom.lambdaisland/xml-select {:mvn/version \"0.2.5\"}\n```\n\nor add the following to your `project.clj` ([Leiningen](https://leiningen.org/))\n\n```\n[com.lambdaisland/xml-select \"0.2.5\"]\n```\n\u003c!-- /installation --\u003e\n\n## Rationale\n\n## Usage\n\n\u003c!-- opencollective --\u003e\n## Lambda Island Open Source\n\nThank you! xml-select is made possible thanks to our generous backers. [Become a\nbacker on OpenCollective](https://opencollective.com/lambda-island) so that we\ncan continue to make xml-select better.\n\n\u003ca href=\"https://opencollective.com/lambda-island\"\u003e\n\u003cimg src=\"https://opencollective.com/lambda-island/organizations.svg?avatarHeight=46\u0026width=800\u0026button=false\"\u003e\n\u003cimg src=\"https://opencollective.com/lambda-island/individuals.svg?avatarHeight=46\u0026width=800\u0026button=false\"\u003e\n\u003c/a\u003e\n\u003cimg align=\"left\" src=\"https://github.com/lambdaisland/open-source/raw/master/artwork/lighthouse_readme.png\"\u003e\n\n\u0026nbsp;\n\nxml-select is part of a growing collection of quality Clojure libraries created and maintained\nby the fine folks at [Gaiwan](https://gaiwan.co).\n\nPay it forward by [becoming a backer on our OpenCollective](http://opencollective.com/lambda-island),\nso that we continue to enjoy a thriving Clojure ecosystem.\n\nYou can find an overview of all our different projects at [lambdaisland/open-source](https://github.com/lambdaisland/open-source).\n\n\u0026nbsp;\n\n\u0026nbsp;\n\u003c!-- /opencollective --\u003e\n\n\u003c!-- contributing --\u003e\n## Contributing\n\nWe warmly welcome patches to xml-select. Please keep in mind the following:\n\n- adhere to the [LambdaIsland Clojure Style Guide](https://nextjournal.com/lambdaisland/clojure-style-guide)\n- write patches that solve a problem \n- start by stating the problem, then supply a minimal solution `*`\n- by contributing you agree to license your contributions as MPL 2.0\n- don't break the contract with downstream consumers `**`\n- don't break the tests\n\nWe would very much appreciate it if you also\n\n- update the CHANGELOG and README\n- add tests for new functionality\n\nWe recommend opening an issue first, before opening a pull request. That way we\ncan make sure we agree what the problem is, and discuss how best to solve it.\nThis is especially true if you add new dependencies, or significantly increase\nthe API surface. In cases like these we need to decide if these changes are in\nline with the project's goals.\n\n`*` This goes for features too, a feature needs to solve a problem. State the problem it solves first, only then move on to solving it.\n\n`**` Projects that have a version that starts with `0.` may still see breaking changes, although we also consider the level of community adoption. The more widespread a project is, the less likely we're willing to introduce breakage. See [LambdaIsland-flavored Versioning](https://github.com/lambdaisland/open-source#lambdaisland-flavored-versioning) for more info.\n\u003c!-- /contributing --\u003e\n\n\u003c!-- license --\u003e\n## License\n\nCopyright \u0026copy; 2024 Arne Brasseur and Contributors\n\nLicensed under the term of the Mozilla Public License 2.0, see LICENSE.\n\u003c!-- /license --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flambdaisland%2Fxml-select","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flambdaisland%2Fxml-select","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flambdaisland%2Fxml-select/lists"}