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
B
Correct answer
Explanation
The XML version declaration must use the processing instruction syntax with both opening and closing question marks: . Option A incorrectly closes with />, which is only used for empty elements. Option C omits the required question marks. The declaration must appear at the very start of an XML document.