dom4j Changelog

What's new in dom4j 2.1.4

Jan 22, 2023
  • Updated pull-parser version by @jayknoxqu in #129
  • Reuse the writeAttribute method in writeAttributes. by @Ekryd in #134
  • Support build on OS with non-UTF8 as default charset by @qxo in #96
  • Gradle: add an automatic module name (fixes #67) by @carlosame in #84
  • Use Correct License Name "Plexus" by @tisoft in #98

New in dom4j 2.1.3 (Apr 12, 2020)

  • Improvements:
  • Added new factory method org.dom4j.io.SAXReader.createDefault(). It hase more secure defaults than new SAXReader(), which uses system
  • XMLReaderFactory.createXMLReader() or SAXParserFactory.newInstance().newSAXParser(). SAXReader.createDefault() disable parsing of external entities
  • in the SAX parser.

New in dom4j 2.1.2 (Apr 11, 2020)

  • Added new factory method org.dom4j.io.SAXReader.createDefault(). It hase more secure defaults than new SAXReader(), which uses system
  • XMLReaderFactory.createXMLReader() or SAXParserFactory.newInstance().newSAXParser(). SAXReader.createDefault() disable parsing of external entities
  • in the SAX parser.

New in dom4j 2.1.1 (Nov 1, 2018)

  • Potential breaking changes:
  • If you use some optional dependency of dom4j (for example Jaxen, xsdlib etc.), you need to specify an explicit dependency on it in your project. They are no longer marked as a mandatory transitive dependency by dom4j.
  • Following SAX parser features are disabled by default in DocumentHelper.parse() for security reasons (they were enabled in previous versions):
  • http://xml.org/sax/properties/external-general-entities
  • http://xml.org/sax/properties/external-parameter-entities
  • Fixed issues:
  • #28 Possible vulnerability of DocumentHelper.parseText() to XML injection (reported by @s0m30ne)
  • #34 CVS directories left in the source tree (reported by @ebourg)
  • #38 XMLWriter does not escape supplementary unicode characters correctly (reported by @abenkovskii)
  • #39 writer.writeOpen(x) doesn't write namespaces (reported by @borissmidt)
  • #40 concurrency problem with QNameCache (@jbennett2091)
  • #43 and #46 all dependencies are optional (reported by @Zardoz89 and @vmassol)
  • #44 SAXReader: hardcoded namespace features (reported by @philippeu)
  • #48 validate QNames (reported by @mario-areias)

New in dom4j 1.6.1 (Jun 20, 2013)

  • Updated the XPP2 implementation to version 2.1.10.
  • Fixed a problem with XMLWriterthat was causing too many new lines to be written to the resulting XML.
  • Include more information about the cause if an XPathExceptionor InvalidXPathExceptionis thrown.

New in dom4j 1.6 (Jun 20, 2013)

  • Added a methods to SAXReaderallowing to specify the encoding used when reading XML sources.
  • Changed the DocumentHelper.parseText(String)method to make sure that the XML encoding is always set (if known) on the returned Document, even if the used SAXParser doesn't provide a way to retrieve that encoding.
  • Added a setXMLEncoding(String)method to the Documentinterface.
  • Removed a static OutputFormatfield from AbstractBranch. This can cause problems if multiple threads are using the asXML()method simultaneously.
  • Fixed a whitespace problem with the pretty-print OutputFormat.
  • Fixed a bug in the DefaultElement.setContent(List)method that caused incorrectly resetting the parent of the nodes in the list.
  • Removed persistencepackage and sub-package.
  • Modified SAXEventRecorderto accomodate sax events generated when writing a DOMDocument.
  • Fixed a problem in AbstractDocument.asXML()when an encoding was specified on the Document.
  • The DefaultNamespace.isReadOnly()method now returns false. This fixes issues with cloning this Node.
  • Updated DocumentFactoryto create the instance untill the first time it is needed.
  • Fixed a bug in Stylesheetwhen an xpath expressions was used to select the nodes.
  • Added a SingletonStrategyclass for managing singletons. This allows to use different strategies for singletons, like: one instance per VM, one instance per thread, ... This change removed the usage of ThreadLocals.

New in dom4j 1.5.2 (Jun 20, 2013)

  • Removed the internal Aelfred2 parser due to incompatible license.
  • Added a SAXEventRecorderthat can replay SAX events at a later time. This provides an alternative serialization approach.

New in dom4j 1.5.1 (Jun 20, 2013)

  • Fixed problem where the namespace prefix was lost using DOMDocument.
  • Fixed bug in Document.asXML()which ignored the encoding of the document.
  • Updated NamespaceCacheto use WeakReferences to allow Namespaceobjects to be garbage collected.
  • Updated JAXBReaderto allow ElementHandlers to be notified when the specified path is encountered, without having to unmarshall XML content.
  • Fixed a bug in XMLWriterwhere a NullPointerExceptionwas thrown if trying to write CData section containing nullcontent.
  • Modified the internal Aelfred2 parser to no longer support the SAX2 Extensions 1.1 API. As a result, the SAX2 sources are no included with dom4j.
  • Added support for the XPP3 parser.

New in dom4j 1.5 (Jun 20, 2013)

  • Fixed bug in XMLWriter.characters(...)where the escapeText property of the writer was ignored.
  • Fixed the Stylesheet.removeRule(Rule)method which didn't remove the Rulebut added it again.
  • Fixed bug in BackedListcausing new elements to always be added at the first position if the size of the list is 1.
  • Upgraded the internal Aelfred2 parser to the latest version.
  • Added initial JAXB support.
  • Updated the STAX classes to provide document encoding.
  • Added getXMLEncoding()method to org.dom4j.Documentwhich returns the encoding of the document.