Next Up Previous Contents
Next: 6.5 Editors
Up: 6 Processing your document
Previous: 6.3 Generating HELP files
[ID index][Keyword index]

6.4 Converting to XML

Converting a document to XML cannot always be done automatically, since there are some SGML constructs which do not map easily to XML (for detailed discussions, see James Clark's W3C note on the differences between SGML and XML, and Norm Walsh's notes on converting an SGML DTD to XML, which covers some of the same issues). However, you can get help with this using the program sgml2xml, which converts the body of a document to XML without difficulty, and additionally attempts to convert the declaration subset (see Section 3.3) by rewriting entities to conform to XML's more straitened[Note 9] syntax, and rewriting SUBDOC entities as NDATA XML ones. It can't do everything, however, and so spits out warnings whenever it finds anything in the least problematic.

Use is simple:

sgml2xml myfile.sgml >myfile.xml
See also the notes in the detailed documentation.


Next Up Previous Contents
Next: 6.5 Editors
Up: 6 Processing your document
Previous: 6.3 Generating HELP files
[ID index][Keyword index]
The Starlink SGML Set
Starlink System Note 70
Norman Gray, Mark Taylor
21 April 1999. Release DR-0.7-13. Last updated 24 August 2001