Difference Between SGML and XML
SGML vs XML
SGML (Standard Generalized Markup Language) is the standard for encoding paper documents into an electronic format. With the evolution of the internet, it became clear that HTML is no longer able to provide the need for more dynamic content as it has reached its limitations. XML (Extensible Markup Language) is a language that was derived from SGML and contains a more limited feature set in order to make it simpler for coders to use as SGML is too comprehensive and complex for the intended use. Since XML is simply a subset of SGML, SGML parsers are capable of reading and decoding valid XML files. The reverse is not necessarily true though as SGML files might have features that the XML parser does not understand.
Being a subset, there would be no feature in XML that does not exist in SGML. Here is a short list of what’s been removed.
The following SGML declarations are no longer allowed in XML:
The following SGML constructs are no longer allowed in XML:
- Empty start tags
- Empty end tags
- Unclosed start tags
- Unclosed end tags
Attribute specifications with no name
Directly entered attribute values in attribute specification are not allowed and should be entered in literals
The following SGML entity declarations are no longer allowed in SGML
- External SDATA entities
- Internal SDATA entities
- External CDATA entities
- Internal CDATA entities
- #DEFAULT entities
- PI entities
- Bracketed text entries
You are no longer allowed to specify attributes for entities.
Changes have also been made in the way that coders place comments into their code. A comment declaration is no longer allowed to have more than a single comment. An empty comment declaration has also been disallowed. A parameter separator is disallowed to contain any comment. This includes any markup declaration, excluding comment declarations, of course.
1.XML is a subset of SGML
2.XML is simpler compared to SGML
3.XML documents should be readable with SGML parsers while some SGML might produce errors in XML parsers
4.A list of SGML declarations have been removed in XML
5.Some constructs that are allowed in SGML are no longer permitted in XML
6.Some SGML entities are no longer allowed in XML
7.Some comment practices in SGML have also been disallowed in XML
Search DifferenceBetween.net :
Email This Post : If you like this article or our site. Please spread the word. Share it with your friends/family.