Description
src/main/resources/org/dbunit/dataset/xml/dataset.dtd — the DTD XmlProducer validates incoming documents against when setValidating(true) is enabled — does not declare the <none/> element, even though XmlProducer and XmlDataSetWriter both read and write it to represent ITable.NO_VALUE (a column with no value provided, distinct from an explicit <null/>).
Any XML dataset document containing <none/>, parsed with validation enabled, fails with:
org.dbunit.dataset.DataSetException: Line 1: Element type "none" must be declared.
Root cause
<none/> was intentionally removed from dataset.dtd in 2002 (commit 56c8cb5, "<none/> is not supported anymore") ahead of adding binary data type support. Support was reintroduced into the XML producer during the 2003–2004 Electric XML → SAX2 rewrite (commit 4551af2; see also the 2.0 and 2.1 changes.xml entries, the latter explicitly documenting <none/> as the mechanism for omitting values from generated INSERT statements), but the shipped dataset.dtd resource was never updated to match. XmlDataSet's own class-level Javadoc already documents the correct, complete DTD (including <!ELEMENT none EMPTY>), so the code and its own documentation have been ahead of the packaged validation DTD for roughly two decades.
Impact
Only affects callers that explicitly enable DTD validation (XmlProducer.setValidating(true)); non-validating use (the default) is unaffected. No existing test exercised this combination, which is how it went unnoticed for so long.
Description
src/main/resources/org/dbunit/dataset/xml/dataset.dtd— the DTDXmlProducervalidates incoming documents against whensetValidating(true)is enabled — does not declare the<none/>element, even thoughXmlProducerandXmlDataSetWriterboth read and write it to representITable.NO_VALUE(a column with no value provided, distinct from an explicit<null/>).Any XML dataset document containing
<none/>, parsed with validation enabled, fails with:Root cause
<none/>was intentionally removed fromdataset.dtdin 2002 (commit 56c8cb5, "<none/>is not supported anymore") ahead of adding binary data type support. Support was reintroduced into the XML producer during the 2003–2004 Electric XML → SAX2 rewrite (commit 4551af2; see also the 2.0 and 2.1changes.xmlentries, the latter explicitly documenting<none/>as the mechanism for omitting values from generated INSERT statements), but the shippeddataset.dtdresource was never updated to match.XmlDataSet's own class-level Javadoc already documents the correct, complete DTD (including<!ELEMENT none EMPTY>), so the code and its own documentation have been ahead of the packaged validation DTD for roughly two decades.Impact
Only affects callers that explicitly enable DTD validation (
XmlProducer.setValidating(true)); non-validating use (the default) is unaffected. No existing test exercised this combination, which is how it went unnoticed for so long.