What is the correct syntax of the declaration which defines the XML version?
-
<?xml version="1.0" />
-
<xml version="1.0" />
-
<?xml version="1.0"?>
-
None of the above
C
Correct answer
Explanation
The correct XML version declaration is . Note that it uses a question mark at both the beginning and end, and it ends with ?> not />. This is a processing instruction (PI), not an element, so it doesn't follow XML element syntax. Option A incorrectly uses /> (element closing syntax), and option B omits the opening ?.