Converting to XML

The wide range of software supporting XML will prompt some to consider converting SGML documents to XML format. Unfortunately, this is not as simple a task as converting the other way. This is due to the fact that SGML has a far wider range of capabilities.

The SGML Declaration

XML uses the same characters for markup delimiters as specified by the default SGML declarations. For example, the characters '</' indicate the start of an end-tag in XML, just as they do in the SGML reference concrete syntax. If the SGML declaration in use redefines any delimiters, both the SGML declaration must be changed to the default case, and all affected DTDs and document instances must be processed accordingly:

 <!-- SGML --> GENERAL SGMLREF STAGO ...

Get XML Companion, The, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.