jsoup 1.5.1 released
2011-Feb-19 jsoup 1.5.1 has been released and is now available for download.
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(text)), 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.
Features, fixes, and improvements
- Added ability to change an element's tag with
Element.tagName(String), and to change many at once with
Node.after(String), to allow HTML to be easily added to all nodes. These functions were previously supported on Elements only.
TextNode.splitText(int), 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.
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.
Jsoup.connectto always follow relative links, regardless of the underlying HTTP sub-system.
U(underline) element as an inline tag.
- Force strict entity matching (must be
&xxx) in element attributes.
Elements.clone()(contributed by knz).
- Fixed tokeniser optimisation when scanning for missing data element close tags.
- Fixed issue when using descendant regex attribute selectors.