Is this one a valid XML instance? It has nothing between the the XML declaration and the root node.
<?xml version="1.0" encoding="UTF-8"?><data></data>
I could not find the right place in the XML specification myself and hope that somebody will help me…
The spec (see 2.8 Prolog and Document Type Declaration) does not require (but does allow) a newline to follow the XML Declaration.
Formally this is written as:
As you can see in
[22] prologthe XML Declaration is optional (see the questionark after the symbol) and zero, one or more (see the star)Misccan follow which are: Comments, other Processing Instructions (PI) or Whitespace (S). Whitespace includes the newline.Because
Miscis optional here, there can but need not follow a newline after the declaration.