PHPackages                             diversen/simple-query-selector - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. diversen/simple-query-selector

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

diversen/simple-query-selector
==============================

A very simple way to query simpleXML documents using CSS selectors

v1.0.4(8y ago)160MITPHP

Since Jul 9Pushed 8y ago1 watchersCompare

[ Source](https://github.com/diversen/simple-query-selector)[ Packagist](https://packagist.org/packages/diversen/simple-query-selector)[ RSS](/packages/diversen-simple-query-selector/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (6)Used By (0)

simple-query-selector
=====================

[](#simple-query-selector)

Very simple query-selector for e.g. XML and HTML documents. It uses symfony `CssSelector` in order to make jQuery-like queries on a DOM-tree. `CssSelector` rewrites xpath expressions to CSS-selectors, which for most web-developers are much easier to understand and work with. Css-selectors is also what e.g. jQuery uses, which then makes it familiar to almost any web-developer.

The `query-selector` class just wraps the functionality of the `CssSelector`.

Install
-------

[](#install)

```
composer require diversen/simple-query-selector

```

Usage
-----

[](#usage)

See [test.php](test.php) and [test.xml](test.xml)

Notice
------

[](#notice)

CssSelector or XPath does not like case-diffrence in the XML it searches through. You will need some kind of normalisation if your XML has different cases, e.g. a tag like `` will most likely cause problems. Normalize your XML-string with a function like this:

```
$xml = preg_replace_callback("/(]+)/", function ($matches) {
	return strtolower($matches[1]);
}, $xml);

```

License
-------

[](#license)

MIT © Dennis Iversen

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

5

Last Release

3212d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/23ed91d104f16d10414811ecdafbd5c80a660e658d80ccaadf84f512cfb50629?d=identicon)[diversen](/maintainers/diversen)

---

Top Contributors

[![diversen](https://avatars.githubusercontent.com/u/142675?v=4)](https://github.com/diversen "diversen (5 commits)")

---

Tags

domjquerycss-selector

### Embed Badge

![Health badge](/badges/diversen-simple-query-selector/health.svg)

```
[![Health](https://phpackages.com/badges/diversen-simple-query-selector/health.svg)](https://phpackages.com/packages/diversen-simple-query-selector)
```

###  Alternatives

[yajra/laravel-datatables-oracle

jQuery DataTables API for Laravel

4.9k33.8M338](/packages/yajra-laravel-datatables-oracle)[wa72/htmlpagedom

jQuery-inspired DOM manipulation extension for Symfony's Crawler

3383.9M34](/packages/wa72-htmlpagedom)[yajra/laravel-datatables-html

Laravel DataTables HTML builder plugin

2899.6M48](/packages/yajra-laravel-datatables-html)[yajra/laravel-datatables-buttons

Laravel DataTables Buttons Plugin.

2629.1M54](/packages/yajra-laravel-datatables-buttons)[kartik-v/dependent-dropdown

A multi level dependent dropdown JQuery plugin that allows nested dependencies.

1805.0M3](/packages/kartik-v-dependent-dropdown)[kartik-v/yii2-widget-datepicker

Enhanced Yii2 wrapper for the bootstrap datepicker plugin (sub repo split from yii2-widgets).

1097.0M60](/packages/kartik-v-yii2-widget-datepicker)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
