Multiple choice technology web technology

What is the correct syntax of the declaration which defines the XML version?

  1. <?xml version="1.0" />

  2. <xml version="1.0" />

  3. <?xml version="1.0"?>

  4. None of the above

Reveal answer Fill a bubble to check yourself
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 ?.