A small but change happened in JDK 8 (AdoptOpenJDK / Temurin) between u292 and u332. In u332, DOM to XML conversion of a br
DOM element emits the string <br />
. In u292, the Transformer emits the string without the space: <br/>
.
In the XML specification I found the rules for Tags for empty elements (https://www.w3.org/TR/xml/#d0e2480). Do I understand correctly that <br/>
did not comply with the specification?
(as there must be at least one whitespace between slash and closing greater-than sign)
CodePudding user response:
No, there may be, but need not be, whitespace immediately preceding the />
:
[44] EmptyElemTag ::= '<' Name (S Attribute)* S? '/>' [WFC: Unique Att Spec]
The ?
in S?
means that S
(whitespace) may optionally appear.
Software should not depend upon the presence or absence whitespace there.