{"id":16015721,"url":"https://github.com/detachhead/kotlinxpath","last_synced_at":"2026-01-21T14:08:27.888Z","repository":{"id":52959606,"uuid":"269971836","full_name":"DetachHead/kotlinxpath","owner":"DetachHead","description":"kotlin typesafe builder for xpath","archived":false,"fork":false,"pushed_at":"2021-08-10T11:21:07.000Z","size":512,"stargazers_count":4,"open_issues_count":9,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-14T08:11:43.687Z","etag":null,"topics":["hacktoberfest","kotlin","kotlin-typesafe-builder","kotlin-xpath","kotlin-xpath-builder","xpath","xpath-builder","xpath-generator"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DetachHead.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-06T12:15:57.000Z","updated_at":"2022-10-03T16:21:28.000Z","dependencies_parsed_at":"2022-08-24T09:10:09.071Z","dependency_job_id":null,"html_url":"https://github.com/DetachHead/kotlinxpath","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/DetachHead/kotlinxpath","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DetachHead%2Fkotlinxpath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DetachHead%2Fkotlinxpath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DetachHead%2Fkotlinxpath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DetachHead%2Fkotlinxpath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DetachHead","download_url":"https://codeload.github.com/DetachHead/kotlinxpath/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DetachHead%2Fkotlinxpath/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28634790,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["hacktoberfest","kotlin","kotlin-typesafe-builder","kotlin-xpath","kotlin-xpath-builder","xpath","xpath-builder","xpath-generator"],"created_at":"2024-10-08T15:42:17.208Z","updated_at":"2026-01-21T14:08:27.872Z","avatar_url":"https://github.com/DetachHead.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kotlinxpath\nA Kotlin typesafe builder for xpath with helpful shortcuts for handling the pain points, such as case sensitivity, quote escaping and HTML-specific helper functions.\n\n[documentation](https://detachhead.github.io/kotlinxpath/kotlinxpath/index.html)\n\n![CI](https://github.com/DetachHead/xpath-builder/workflows/CI/badge.svg)\n\n## Example\n```kotlin\nassertEquals(\n    \"/descendant-or-self::node()/child::div[attribute::id = '1']/child::span\",\n    xpath { any / div[{ attr(\"id\") equal \"1\" }] / span }.toString()\n)\n```\n## features\n### helpers\nthis library includes several useful shortcuts to help with common patterns.\n#### examples\n##### textIs\nconverts all text to lowercase, automatically handles quote escaping and trims any whitespace\n```kotlin\nassertEquals(\n    \"/descendant-or-self::node()/child::*[translate(normalize-space(self::node()),'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz') = concat('\\\"That',\\\"'\\\",'s mine\\\", he said.')]\",\n    xpath {\n        anyNode[textIs(\"\\\"That's mine\\\", he said.\")]\n    }.toString()\n)\n```\n##### hasClass\nchecks whether the element has the given class\n```kotlin\nassertEquals(\n    \"/descendant-or-self::node()/child::*[contains(concat(' ',attribute::class,' '),' foo ')]\",\n    xpath { anyNode[hasClass(\"foo\")] }.toString()\n)\n```\n### shims\nmost implementations of xpath still use xpath 1.0 (including all the modern browsers), so this library includes shims for some functions available in xpath 2+\n\nnote: there's only a couple shims in here at the moment. intending to add more in the future.\n#### examples\n##### lower-case\n```kotlin\nassertEquals(\n    \"translate('Foo','ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz') = 'foo'\",\n    expression { `lower-case`(\"Foo\") equal \"foo\" }.toString()\n)\n```\n\n## setup\nin your `build.gradle.kts`:\n```kotlin\nrepositories {\n    maven(\"https://detachhead.github.io/maven\")\n}\n```\n\n### multiplatform projects\n\n```kotlin\nkotlin {\n    sourceSets {\n        val commonMain by getting {\n            dependencies {\n                implementation(\"io.github.detachhead:kotlinxpath:$version\")\n            }\n        }\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdetachhead%2Fkotlinxpath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdetachhead%2Fkotlinxpath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdetachhead%2Fkotlinxpath/lists"}