Release notes
May. 15, 2013: HtmlCleaner release 2.5
- Fixed Issue 77: HeadlessTagNode Constructor Does Not Correctly Copy Wrapped TagNode's Children
- Fixed Issue 69: leaking resources - connection not closed
- Fixed Issue 67: New line after XML declaration is wrongly taken into account
- Fixed Issue 58/62: xml: namespace error on DomSerializer
- Fixed Issue 55: Doctype upper case, name and validation
- Fixed Issue 52: Bad serialization of HTML5 DOCTYPE clauses
- Fixed Issue 48: Mutiple requests for the HTML page in 2.2
- DocType handling has been significantly enhanced with support for parsing all currently valid DocTypes and providing additional information via the Java API.
Mar. 5, 2013: HtmlCleaner release 2.4
- This is a major merge of the Github fork into the core HtmlCleaner code.
Feb. 8, 2013: HtmlCleaner release 2.2.1
- An issue with Hex-based character encoding was fixed.
Dec. 22, 2010: HtmlCleaner release 2.2
- HtmlCleaner is now thread-safe. Single instance can be used from multiple threads to parse multiple html sources safely. All serializers coming in the package are thread-safe as well.
- Html-based serializers are introduced, intended to produce browser-friendly HTML. Now there are basically two serializer flavors: XML (simple, pretty, compact) and HTML (simple, pretty, compact). Html serializers doesn't strictly produce well-formed XML, but rather HTML for further browser consumption (for example special entities like Α are preserved, not escaped with &Alpha;, empty tags like script are not serialized as <script /> but rather as <script></script>)
-
New parameter
transResCharsToNCRis introduced, telling whether reserved XML characters (&, ", ', <, >) are serialized to their Numeric Character Representations (&#dd;) -
New parameter
transSpecialEntitiesToNCRis introduced, telling whether special HTML entities (Α for example) are serialized to their Numeric Character Representations (&#dd;) -
Parameter
omitHtmlEnvelopegets deprecated and new parameteromitEnvelopein command line/Ant and optional parameter in methods XXXSerializer.writeToXXX() is introduced instead, moving this logic to the right place. This way the whole body wihout enclosing tags is serialized, not only the first inner node as before. -
List of special HTML entities is extended with number of new ones. Class
SpecialEntityholding them has public methodaddEntity(entityName, entityCode)to define new ones if some are still missing. - TagNode has number of new methods for easier node manipulation (see API docs)
-
Visitor concept is implemented in
TagNodein order to easily traverse DOM tree and collect some data/update the document. - Pretty XML/HTML serializers have optional parameter in constructors specifying indentation string (default is TAB character).
- Tag definitions updated (col, legend...) to be consistent with the browsers.
- Invalid XML characters are skipped during parsing/serialization.
- DOM/JDom serialization bug fixes.
- Namespaces found in source HTML are now handled properly (depending on omitXmlnsAttributes parameter).
- Method HtmlClenaer.getAllTags() is removed, since this approach doesn't go with introduced thread-safety.
- Few classes are renamed:
ContentToken -> ContentNode, CommentToken -> CommentNode. - Parameter
ignoreQuestAndExclamhas now default valuetrue. - Source code now has standard MAVEN structure.
- HtmlCleaner now depends on Java runtime 1.5+.
- For the list of fixed bugs see Bug tracking at SourceForge.
Sep. 02, 2008: HtmlCleaner release 2.1
- Parsing transformations are developed in order to easily skip or change specified tags or attributes during the cleanup process.
-
Few more constructors added in class
HtmlCleanergiving possibility to reuse same cleaner properties with multiple cleaner instances. - Code cleanup.
Jul. 15, 2008: HtmlCleaner release 2.0
- Complete code refactoring is done so as to better separate roles of cleaner, cleaner properties, object model nodes and serializators. API is not compatible with previous versions, though it is still very simple for use.
-
Post-cleaning node manipulation is enabled with rich set of methods in
TagNodeclass. Now, there is no need to create DOM or JDom out of HtmlCleaner object model in order to select, add or remove some nodes or attributes. - Basic XPath is supported on HtmlCleaner object model. Despite partial implementation, if should be power enough to find or collect nodes/attributes/text even with fairly complex criteria.
-
Modifying already cleaned HtmlCleaner object model is enabled with
HtmlCleaner.setInnerHtml(node, html)similar to DHTML feature to set inner html of an object. - Creating custom tag rule set is now much easier by defining XML configuration file.
-
New properties
booleanAttributeValuesandnodeByXPathfor setting cleaner's behavior are introduced. - Test cases added to source code.
- Memory leak problem in Java 1.4 fixed.
- Number of bug fixes.
Dec. 26, 2007: HtmlCleaner release 1.6
-
New flag parameter
ignoreQuestAndExclamis introduced offering control over special tags -<?TAGNAME....>,<!TAGNAME....>. - Bug fixes.
Sep. 27, 2007: HtmlCleaner release 1.55
- Added
Readerbased HtmlCleaner constructors. -
New parameter
pruneTagsis introduced offering a way to remove undesired tags with all the children from XML tree after parsing and cleaning. - Bug fixes.
Sep. 8, 2007: HtmlCleaner release 1.5
- Several bug fixes.
-
Added option to escape XML content in DOM serializer -
HtmlCleaner.createDOM(boolean escapeXml)
Aug. 24, 2007: HtmlCleaner release 1.4
-
New flag
allowHtmlInsideAttributesis introduced in order to give the parser flexibility in handling attribute values. - Several bug fixes.
Jul. 12, 2007: HtmlCleaner release 1.3
- New
browser-compactserializer added, that preserves single whitespace where multiple occure. -
New flag
namespacesAwareis introduced in order to control namespace prefixes and namespace declarations. It should be used instead ofomitXmlnsAttributesthat existed in previous versions and had limited functionality. - New flag
allowMultiWordAttributesis introduced giving HtmlCleaner's parser flexibility to (dis)allow tag attributes consisting of multiple words. - New flag
useEmptyElementTagsis introduced in order to controll output of tags with empty body
(<xxx/> vs <xxx></xxx>). - Several bug fixes.
May. 05, 2007: HtmlCleaner release 1.2
- Several bugs fixed.
- New flags added to control behaviour of unknown/deprecated tags.
- New flag added to optionally remove HTML envelope from resulting XML.
- JDOM serializer added.
Apr. 13, 2007: HtmlCleaner release 1.13
- Serialization of XML to Java DOM supported with
createDOM()method ofHtmlCleanerclass.
Jan. 28, 2007: HtmlCleaner release 1.12
- Hexadecimal entities escaping supported (i.e. 	).
Jan. 11, 2007: HtmlCleaner release 1.1
- Compact XML serializer improved.
- Minor XML escaping bug fixed.
Jan. 02, 2007: HtmlCleaner release 1.0.5
- A html tokenizing bug fixed.
- Methods of the class TagNode made public in order to enable creating custom XML serializers.
- Method writeXml(XmlSerializer) added to HtmlCleaner class in order to support creating custom XML serializers.
Dec. 23, 2006: HtmlCleaner release 1.0
- Minor bug in advanced XML escaping fixed.
Dec. 05, 2006: HtmlCleaner release 0.9
- HtmlCleaner Ant task added
- XML compact serializer added - stripps all unneeded whitespaces from the result
- Few minor bugs fixed
Nov. 27, 2006: HtmlCleaner initial release (version 0.8)

