chrsan/css-selectors

Integration of css-selectors in jOOX

Closed this issue · 10 comments

Hello Christer,

I'm thrilled to see that you already implemented most (if not all) of the CSS selector parsing in Java. This looks like quite good work!

I'm the developer of jOOX, a jquery port to Java, and I would like to integrate the CSS selector syntax into jOOX. Currently, jOOX only allows for using XPath, which is slightly less intuitive. See some information about jOOX here:

http://code.google.com/p/joox/
https://github.com/lukaseder/jOOX

I am now putting a bit more effort into jOOX, as I see great potential in it (giving most credit to its inspiration jquery, of course).

Now, in order to integrate your project css-selectors into jOOX, there are a couple of open questions:

  • css-selectors is not in Maven Central, nor is www.fishtank.se available. Is this still an active project?
  • Are you interested in a collaboration, or would you prefer if I forked your project?
  • Your licenses (BSD, MIT) are a bit more permissive than mine (ASL 2.0), which means I am allowed to integrate your project in mine, without changing my own license. Do you agree with this? Otherwise, since you don't seem to worry so much about your license, would you mind adding ASL 2.0 to the list of choosable licenses? Some insight can be found here:

http://www.dwheeler.com/essays/floss-license-slide.html
http://stackoverflow.com/questions/40100/apache-licence-vs-bsd-vs-mit

Hi!

I'm the kind of guy who never knows what to write except code. That's why fishtank.se doesn't contain anything. It's just a domain name registered by me. About the license I just added the ones I noticed that other projects are using, and I chose the more liberal ones. I don't like licenses and I know nothing about them. Regarding Maven I have been thinking about creating a Sonatype Maven account, but have been too busy.

So...

Your project seems very cool indeed and I would be glad if you'd like to use my stuff. Of course I could add the Apache license. If you'd like to help out by sending me a pull request and point me in the right direction regardning Maven I would be most greatful. I haven't been programming Java for the last 2 years and I'm currently working on porting this project to Scala with its built in parser combinator etc.

Awesome!

I know that feeling about having to write other things than code, every now and then :-)

I have started integrating the scanner into jOOX, I don't think I'll need the processing classes, as I prefer translating css selectors into XPath expressions. It works like a charm for the $(...).find() method

About the Apache license: As far as I know, to correctly apply it, you'll have to add this header to every file (as well as to your LICENSE file) in your project:

   Copyright [yyyy] [name of copyright owner]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

The source can be found here:
http://www.apache.org/licenses/LICENSE-2.0

I'm not sure how to combine it with other licenses. The best thing would be to add a remark into the header saying that people who don't want to use Apache 2.0 can remove the header.

About Maven Central, I'll forward you some instructions later on, which I have gotten for doing that myself. It's quite a few steps, but the Sonatype guys are also helpful

Cheers
Lukas

OK, so I found some time to dig up that mail I received a year ago by a jOOQ user explaining how to go to Maven Central. You're still missing quite a few elements in your pom.xml. Most essentially, these things are missing:

  • configuration, specifying that sonatype is your "parent"
  • A reference to your license
  • A reference to your official source control management
  • The maven-gpg-plugin, for signing your artefacts with gpg
  • The maven-source-plugin and maven-javadoc-plugin, as you have to publish binaries, sources and javadoc

For full details, see this page here:
https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide

Also, you can check out jOOX's pom.xml. It meets all of Sonatype's and Maven Central's requirements:
https://github.com/lukaseder/jOOX/blob/master/jOOX/pom.xml

Let me know if you need any more help

Cheers
Lukas

Thank you very much. I'll have a look at it ASAP, but I'm going away this weekend.

Sure, no hurry! :-) Enjoy!

Christer, I too am interested in this project. I would like to integrate it with ActiveWeb: http://code.google.com/p/activeweb/ testing framework in order to provide functionality similar to assert_select in Ruby on Rails:
http://api.rubyonrails.org/classes/ActionDispatch/Assertions/SelectorAssertions.html

This will allow ActiveWeb developers to easily write tests that can check structure and content of generated HTML.

I can offer help deploying this great library to Sonatype (had to learn this for my projects). If you have any questions in addition to the tips Lukas provided above, I'm here to help,

thanks
Igor

Hi Igor! I created a Sonatype account when I relased my other CSS selector library written in Scala. I'll try to get into releasing this library as well sometime soon when I have the time to do so. I'll get back to you if I need any help (i.e. run out of time etc).

/Christer

Christer, thanks, your help is much appreciated
igor

Hey, has this been released yet?

Hi Evan,

Yes this has been released in jOOX. jOOX makes use of Christer's css-selector functionality to transform CSS selectors into XPath expressions

Cheers
Lukas