On Tue, 7 Jul 2026 17:39:36 GMT, Michael Strauß <[email protected]> wrote:

>> I think the first line in xml identifies the format and the encoding, the  
>> header should follow after that.
>
>> I think the first line in xml identifies the format and the encoding, the 
>> header should follow after that.
> 
> This is correct. The most recent [XML 
> specification](https://www.w3.org/TR/xml/) says:
> 
> document ::= prolog element Misc*
> prolog ::= XMLDecl? Misc* (doctypedecl Misc*)?
> XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
> Misc ::= Comment | PI | S
> 
> 
> This means that the prolog of an XML document _may_ start with an `<?xml ... 
> ?>` declaration (actually, the spec says it _should_, but it's optional). If 
> it does, it must be the very first thing in the document; comments are only 
> allowed after it.

interesting - I just checked and indeed the same pattern is used in the 
[JDK](https://github.com/openjdk/jdk/blob/master/make/langtools/build.xml). The 
only exception is the 
[pom.xml](https://github.com/openjdk/jdk/blob/master/src/utils/LogCompilation/pom.xml)
 sometimes.

EDIT: Thanks Michael for the link, that explains it.

TIL. So just ignore my comment 😄

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/2167#discussion_r3538526894

Reply via email to