Discussion:
[PEPr] Proposal for XML::cssparser
Gonzalo Chumillas
2013-09-25 01:19:31 UTC
Permalink
Gonzalo Chumillas (http://pear.php.net/user/cequiel) proposes XML::cssparser.

You can find more detailed information here:
http://pear.php.net/pepr/pepr-proposal-show.php?id=697
--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Vasil Rangelov
2013-09-25 13:44:45 UTC
Permalink
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.
--
http://pear.php.net/pepr/pepr-proposal-show.php?id=697
--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Bertrand Mansion
2013-09-25 18:33:38 UTC
Permalink
The package name is misleading.

I suggest XML_Select or XML_Selector.
--
http://pear.php.net/pepr/pepr-proposal-show.php?id=697
--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Gonzalo Chumillas
2013-09-25 19:22:48 UTC
Permalink
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.
--
http://pear.php.net/pepr/pepr-proposal-show.php?id=697
--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Bertrand Mansion
2013-09-25 19:55:39 UTC
Permalink
You are not required to use namespaces, as far as I know.
--
http://pear.php.net/pepr/pepr-proposal-show.php?id=697
--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Gonzalo Chumillas
2014-01-28 23:51:10 UTC
Permalink
Gonzalo Chumillas (http://pear.php.net/user/cequiel) has initiated the call for votes on XML::XML_CSSSelector.

Please review the proposal and give your vote here:
http://pear.php.net/pepr/pepr-proposal-show.php?id=697
--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Loading...