Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

why is there a "?" in the beginning of an xml document  RSS feed

 
Joe May
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Was just wondering.. is there any logical reason for the "?" at the beginning of an xml document?

<?xml version="1.0 encoding="some_encoding">

Thanks
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is the format required by the standard. One function is to tell the parser that the < does not start a normal tag.

See also the use of special characters in the format for comments and DOCTYPE declarations.

Bill
 
g tsuji
Ranch Hand
Posts: 697
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read carefully: <? opening tag, ?> closing tag. The simple line contains already two mistakes (another is version, a genuine typo, possibly).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!