I thought XML is an application of SGML, and that the default syntax for an SGML declaration starts with "<!" delimiter.
Based on that understanding, I’m not clear how "<?" comes about.
Would someone please cxplain? Thank you.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
<!begins a DOCTYPE declaration, and<?begins a processing instruction. The<?xmlprocessing instruction is specified by the standard to indicate that what follows is XML, indicate the version of XML and the text encoding. It has no relationship to the actual structure of the document, which is something the DOCTYPE declaration would. I’m not sure why the DOCTYPE declaration is specified differently than a processing instruction, but a lot (maybe most) XML documents these days have their structure defined by XML schema or RelaxNG instead, and only a DTD can be referenced from the DOCTYPE. There are other ways to use processing instructions; mostly they were introduced to provide vendors with a side entrance for their own features. Probably the second most common use is for linking to XSLT or CSS stylesheets.XML was originally conceived as a simplified subset of SGML, but since then it has become much more different. It wouldn’t really be fair to say XML “is” SGML anymore in any sense, just that they are related by history and genealogy.