chrsan/css-selectors — pull request #9 by jheintz (2012-10-15 04:30:07+00:00)
Title: Added Generic NodeSelector implementation

Christer, I've used this framework in the mechanize for java project to add CSS Selectors to JSON, it worked great. Thanks for sharing this framework!

See https://github.com/GistLabs/mechanize/blob/master/src/main/java/com/gistlabs/mechanize/json/nodeImpl/JsonNodeHelper.java

In the course of doing this I started with the DOMNodeSelector and generalized the code around a "NodeHelper" that contained all of the specific knowledge of how to match against Nodes of any type.

I would really like for you to embed and maintain this generic implementation, it's not really pertinent to mechanize and I think it's a reasonable way for this project to support non-DOM projects.

(Note: mechanize is working in pure Java so that it can seamlessly work in Android devices, or similar. Scala is a future direction but right now we want simple and functional deployment in the most common Java/JVM environments.)