From d6fd78b96837969dc36ff852a3288fd45f8f9e61 Mon Sep 17 00:00:00 2001 From: Artur Weigandt Date: Mon, 16 May 2022 12:04:43 +0200 Subject: Allow CssXPath updates with composer (#4368) * Install CssXPath with composer * Fix code style in tests * fix pathnames for tests and linting * add irrelevant files to .gitignore * Alphabetic order * let composer sort the packages alphabetically Co-authored-by: Alexandre Alapetite --- lib/phpgt/cssxpath/README.md | 53 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 lib/phpgt/cssxpath/README.md (limited to 'lib/phpgt/cssxpath/README.md') diff --git a/lib/phpgt/cssxpath/README.md b/lib/phpgt/cssxpath/README.md new file mode 100644 index 000000000..9082c8bbf --- /dev/null +++ b/lib/phpgt/cssxpath/README.md @@ -0,0 +1,53 @@ +Translate CSS selectors to XPath queries. +========================================= + +A lightweight and dependency free CSS to XPath translator. This repository is used to bring modern DOM functionality like [`querySelectorAll()`][qsa] to PHP in the [PHP.Gt/Dom][gt-dom] project. + +*** + + + Build status + + + Code quality + + + Code coverage + + + Current version + + + PHP.Gt/CssXPath documentation + + +Example usage +------------- + + +```php +use Gt\CssXPath\Translator; + +$html = << + + + + +HTML; + +$document = new DOMDocument(); +$document->loadHTML($html); + +$xpath = new DOMXPath($document); +$inputElementList = $xpath->query(new Translator("form>label>input"); +``` + +[qsa]: https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll +[gt-dom]: https://www.php.gt/dom -- cgit v1.2.3