A library for building Xpath queries in an OOP style. In a JOOQ way, but for the XPATH.
Apache Maven
<dependency>
<groupId>org.xpathqs</groupId>
<artifactId>core</artifactId>
<version>0.0.7</version>
</dependency>
Gradle Kotlin DSL
implementation("org.xpathqs:core:0.0.7")
Gradle Groovy DSL
implementation 'org.xpathqs:core:0.0.7'
Simple selector with tag and text:
tagSelector("div").text("demo").toXpath()
Will return such XPATH query:
//div[text()='test']
Selector with tag, text contains, and position:
tagSelector("div").text("test", contains = true)[2].toXpath()
Result:
//div[contains(text(), 'test') and position()=2]
For more examples you can discover unit tests.
...
- One line per func call
Each public method should:
- contain java-doc
- have a contract and requirements
- have a link to the unit-tests associated with a concrete requirement
This XpathQS lib is released under the MIT License.