Multiple choice xml

What is the correct declaration syntax for the version of XML document?

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

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

  3. <xml version="1.0" />

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

XML declarations are processing instructions that must start with and end with `?&gt;`. The correct syntax is where the xml keyword is followed by the version attribute. Option A incorrectly closes with /&gt; (processing instructions don't use self-closing tags), and Option C uses element tags `` instead of processing instruction syntax.