Elliot Rusty Harold in his "XML Bible" states right there on page 52
"Every XML document begins with an XML declaration that specifies the
version of the XML in use."
 
Well time for the monks to get out their erasers because as
Mr. Mark Hartman pointed out to me ...


Actually the <?xml version='1.0'> tag (XMLDecl) is optional, so an XML
document can begin with a comment node (part of the Misc production
below).

See the XML Spec http://www.xml.com/axml/testaxml.htm productions:
[22]  prolog ::=  XMLDecl? Misc* (doctypedecl Misc*)?
[23]  XMLDecl ::=  '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
[24]  VersionInfo ::=  S 'version' Eq (' VersionNum ' | " VersionNum ")
[25]  Eq ::=  S? '=' S?
[26]  VersionNum ::=  ([a-zA-Z0-9_.:] | '-')+
[27]  Misc ::=  Comment | PI |  S

----- end of quote ----

Maybe next time I will check out the "XML Quraan", a more definitive
source. 

But according to http://www.xml.com/axml/testaxml.htm
Quote ...

  Because each XML entity not in UTF-8 or UTF-16 format must begin with
an XML encoding declaration, in which the first characters must be
'<?xml', any conforming processor can detect, after two to four octets
of input, which of the following cases apply. In reading this list, it
may help to know that in UCS-4, '<' is "#x0000003C" and '?' is
"#x0000003F", and the Byte Order Mark required of UTF-16 data streams
is "#xFEFF".


-- end quote --

So now it seems that the existenance or non-existenence of of the "XML
declaration" is dependent on the encoding !! 

So from all this I get:
You Should have it, but you don't HAVE to have it, unless the encoding
is not UTF-8 or UTF-16, in which case you DO HAVE to have it.

That's the best they could come up with ! ! !  ;-)

Mike




=====
("\''/").__..-''"`-. .         
  `9_ 9  )   `-. (    ).`-._.`)  Meow!
  (_Y_.)' ._   ) `._`.  " -.-'   
   _..`-'_..-_/ /-'_.'           
 (l)-'' ((i).' ((!.'
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

==========================================
XML/EDI Group members-only discussion list
Homepage =  http://www.xmledi.com

Brought to you by: Online Technologies Corporation
                  Home of BizServe - www.bizserve.com

TO UNSUBSCRIBE: Send email to <[EMAIL PROTECTED]>
               Leave the subject blank, and
               In the body of the message, enter ONLY: unsubscribe

Questions/requests should be sent to: [EMAIL PROTECTED]
To join the XML/EDI Group complete the form located at:
http://www.geocities.com/WallStreet/Floor/5815/mail1.htm

Reply via email to