jsoup 1.5.1 released
2011-Feb-19 jsoup 1.5.1 has been released and is now available for download.
Faster selectors
jsoup now implements single-pass selector evaluators, contributed by Anton Kazennikov. This significantly speeds up the execution of combined selector queries.
Previously when selecting elements with a combined selector (e.g. div:contains(), jsoup would make multiple passes through the DOM for each component of the query, extracting each element that matched the sub-component, then merging and filtering the final result set. The new implementation does the filtering as elements are extracted, enabling a fast single pass through the DOM for the most complicated queries.
Scala support
Brandon Beck contributed a fix that enables jsoup to work in Scala.
Features, fixes, and improvements
- Added ability to change an element's tag with
Element.tagName(, and to change many at once withString) Elements.tagName(.String) - Added
Node.wrap(,String) Node.before(, andString) Node.after(, to allow HTML to be easily added to all nodes. These functions were previously supported on Elements only.String) - Added
TextNode.splitText(, which allows a text node to be split into two nodes at a specified index point. This is convenient if you need to surround some text in an element.int) - Updated
Jsoup.Connectso that cookies set on a redirect response will be included on both the redirected request and response. - Infinite redirection loops in
Jsoup.connectare now prevented. - Allow
Jsoup.connectto parseapplication/xmlandapplication/xhtml+xmlresponses. - Modified
Jsoup.connectto always follow relative links, regardless of the underlying HTTP sub-system. - Defined
U(underline) element as an inline tag. - Force strict entity matching (must be
&xxx;and not&xxx) in element attributes. - Implemented
Elements.clone((contributed by knz).) - Fixed tokeniser optimisation when scanning for missing data element close tags.
- Fixed issue when using descendant regex attribute selectors.