Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement: Xsoup should return xpath attribute matches using getElements() method #17

Open
PatrickHuetter opened this issue Jun 3, 2015 · 0 comments

Comments

@PatrickHuetter
Copy link

At this time, i have to match against a regex rule to decide wich method should be used (wether it's an attribute xpath query or not). I think the getElements() method should also match against attribute xpath queries, this would be a fine improvement.

if (query.matches("(.*/@.*)")) {
            String result = Xsoup.compile(query).evaluate(document).get();
            matches.add(result);
} else {
            Elements results = Xsoup.compile(query).evaluate(document).getElements();
             // following more code wich adds the results to the matches list...
}

Best regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant