Vasil Rangelov [2013-09-25 13:44 UTC]Very interesting.
Just two things:
1. Follow PEAR coding and naming standards. You aren't currently. Particularly problematic is the class "Parser" which is a name so common, that if not namespaced or prefixed is a recipe for disaster.
2. IMHO, it would be a lot more convinient if you have a constructor that does NOT accept a CSS selector, but only a base node, and maybe some parsing options. Only then, have the parse() method accept the selector. In fact, consider renaming it to something like "query()", "select()" or (better yet) "querySelector()" to be familiar to JS users.
Bertrand Mansion [2013-09-25 18:33 UTC]The package name is misleading.
I suggest XML_Select or XML_Selector.
Gonzalo Chumillas [2013-09-25 19:22 UTC]Thanks Vasil and Bertrand for the suggestions. I changed the package name to XML_CSSSelector. Now is most intuitive. About the point 1. I should use namespaces (although I don't like namespaces too much). And about the point 2. I think you are right. It would be more comfortable for the user to pass a DOMNode object only one time and the subsequent queries several times. Thanks.
Bertrand Mansion [2013-09-25 19:55 UTC]You are not required to use namespaces, as far as I know.