Is the XML processing instructions node mandatory ?

Posted by ereOn on Stack Overflow See other posts from Stack Overflow or by ereOn
Published on 2011-01-13T10:40:38Z Indexed on 2011/01/13 10:53 UTC
Read the original article Hit count: 148

Filed under:
|

I had a discussion with a colleague of mine about the XML processing instructions node (I'm talking about this => <?xml version="1.0" encoding="UTF-8"?>).

I believe that for something to be called "valid XML", it requires a processing instructions node.

My colleague states that the processing instruction node is optionnal, since the default encoding is UTF-8 and the version is always 1.0. This make sense, but what does the standard says ?

In short, given the following file:

<books>
  <book id="1"><title>Title</title></book>
</book>

Can we say that:

  1. It is valid XML ?
  2. It is a valid XML node ?
  3. It is a valid XML document ?

Thank you very much.

© Stack Overflow or respective owner

Related posts about Xml

Related posts about naming