<<<TOC  >>>ENCSEN/CSZVONTranslations

12. Is XML Easier than SGML?

This is one of the questions that a lot of people are asking these days: "Isnt XML easier than SGML?" Because if it is, why wouldnt you use XML and forget about SGML?
Heres the answer: If youre a software developer, you will definitely want to consider writing your application based on XML instead of SGML. But if youre publishing on the Internet and on paper, or if youre building large intranet/extranet applications, then XML and SGML are equally easy. Lets look at each type of application.
Software development Theres no question that some tools that support XML will be easier to build. If youre a software developer and you want to use XML as a data interchange format, youll be able to find a freely available parser that will examine an XML data stream. Then you can write a small program to find the XML elements you need and give that data to your processing application. The code will be much smaller than the equivalent code for SGML, which has to parse a DTD (a DTD is not an XML-tagged document, so it requires a separate parsing component) as well as the data itself. And since XML has almost no options, you only have to write a tiny amount of code, if any, to deal with those options.
Since you can get a freely available SGML parser just as easily as an XML parser, you may wonder why it really matters. And the answer is that for any application where a freeware parser is sufficient, the only real difference is code size and speed. An SGML parser is a lot bigger and a little slower. But many application developers, especially those who are working on non-document applications, prefer to write their own parser. And thats way too big a job with SGML.
Creation and delivery If youre aiming to build a database of modular document components that you can easily reuse, interchange, and automate, then XML is no easier than SGML. For these kinds of applications, youll still need to perform all the up-front requirements analysis as well as the rigid enforcement of rules to ensure an absolutely consistent data format.

<<<TOC  >>>ENCSEN/CSZVONTranslations