I am talking XML document not HTML. Since in HTML,
and
are both valid.
Want to know if XML specification defines whether it is
The space at the end is allowed for "normal" tags as well as for empty elements, see https://www.w3.org/TR/xml/#sec-starttags:
Start-tag
STag ::= '<' Name (S Attribute)* S? '>'
Tags for Empty Elements
EmptyElemTag ::= '<' Name (S Attribute)* S? '/>'
Notice the S?
at the end which optionally allows one or more whitespace characters at the end:
S ::= (#x20 | #x9 | #xD | #xA)+