fg / nokogiri
Cuts through XML like a breeze.
Installs: 39 488
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 1
Open Issues: 0
Requires
- php: ^8
Requires (Dev)
- phpunit/phpunit: ^9.3
This package is auto-updated.
Last update: 2024-10-09 14:14:32 UTC
README
Cuts through XML like a breeze.
Examples
Given this XML:
<p> <span>Lorem ipsum dolor <em>sit amet</em>.</span> </p>
Cutting it at the twentieth character...
$Nokogiri = new Nokogiri\Nokogiri(); $Nokogiri->cut($xml, 20);
Would return:
<p> <span>Lorem ipsum dolor <em>sit</em></span> </p>
Cutting it at the eleventh character...
$Nokogiri->cut($xml, 11);
Would return:
<p> <span>Lorem ipsum</span> </p>
Note that the blank characters between tags are not taken into account.
Contributing
Installation
Clone the project and run composer install
.
Running tests
Run tests with composer run-script test
.
Notes
The implementation is probably shitty, as I don't know anything about writing a decent parser...
Also, the implementation of the parser itself is kind of tied to the class using it. It is obviously bad but it works 😁