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
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.