Skip to content
Thomas Weinert edited this page Feb 8, 2017 · 1 revision

Similarities

FluentDOM was created after the jQuery API and concepts. You will notice that the most method names and parameters are the same.

Many thanks to the jQuery (jquery.com) people for their work, who did an exceptional job describing their interfaces and providing examples. This saved us a lot of work. We implemented most of the jQuery methods into FluentDOM

To be able to write PHPUnit Tests and develop FluentDOM a lot of examples were written. Most of them are copied and adapted from or are deeply inspired by the jQuery documentation. They are located in the 'examples' folder. Once again many thanks to the jQuery team.

Differences

XPath selectors

By default every method that supports a selector uses XPath not CSS selectors. Since XPath is supported by the ext/dom extension, no extra parsing need to be done. This should be faster processing the selectors and was easier to implement.

But FluentDOM can use CSS selectors with the help of a converter library.

Text nodes

With a few exceptions FluentDOM handles text nodes just like element nodes. You can select, traverse and manipulate them.

Extensions to PHPs DOM classes

FluentDOM provides extended variants of some of the DOM classes. Most of it is dedicated to improve namespace handling, some works around known problems and some is just for comfort.

You can register namespaces on the document. They will be used if elements or attributes are created/updated and no explicit namespace is provided. You can even register a default namespace for elements.

Clone this wiki locally