手机版
你好,游客 登录 注册
背景:
阅读新闻

jsoup 1.6.2 发布,最棒的 Java HTML 解析器

[日期:2012-03-28] 来源:Linux社区  作者:Linux [字体:大 中 小]

jsoup 1.6.2 发布了,改版包含很多的 bug 修复,松散的 XML 解析模式,功能调整以及内存的改进。

主要改进内容包括:

 - Added a simplified XML parsing mode, which can usefully parse valid and invalid XML, but does not enforce any HTML document structure or special tag behaviour.

 - Added the optional ability to track errors when tokenising and parsing.
 - Added Jsoup.connect.cookies(Map) method, to set multiple cookies at once, possibly from a prior request.
 - Added Element.textNodes() and Element.dataNodes(), to easily access an element's children text nodes and data nodes.
 - Added an example program that demonstrates how to format HTML as plain-text, and the use of the NodeVisitor interface.
 - Added Node.traverse() and Elements.traverse() methods, to iterate through a node's descendants.
 - Updated Jsoup.connect() so that when requests made as POSTs are redirected, the redirect is followed as a GET.
 - Updated the Cleaner and whitelists to optionally preserve related links in elements, instead of converting them to absolute links.
 - Updated the Cleaner to support custom allowed protocols such as "cid:" and "data:".
 - Updated handling of base href tags, to act on only the first one seen when parsing, to align with modern browsers.
 - Updated Node.setBaseUri(), to recursively set on all the node's descendants.
Bug fixes:
 - Fixed an issue where all HTML parse errors where being tracked as new objects, creating high memory pressure on low-memory devices.
 - Fixed handling of null characters within comments.
 - Tweaked escaped entity detection in attributes to not treat &entity_... as an entity form.
 - Fixed doctype tokeniser to allow whitespace between name and public identifier.
 - Fixed issue where comments within a table tag would be duplicate-fostered into body.
 - Fixed an issue where a spurious byte-order-mark at the start of a document would cause the parser to miss head contents.
 - Fixed an issue where content after a frameset could cause a NPE crash. Now correctly implements spec and ignores the trailing content.
 - Tweaked whitespace checks to align with HTML spec.
 - Tweaked HTML output of closing script and style tags to not add an extraneous newline when pretty-printing.
 - Substantially reduced default memory allocation within Node.outerHtml, to reduce memory pressure when serialising smaller DOMs.

详情请看官方发行说明:

http://jsoup.org/news/release-1.6.2

linux
相关资讯       jsoup 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款