Next in thread → Next in month →

Re: DOCBOOK: Question regarding DocBook for SGML and XML

From
Michael Smith <>
Date
2001-12-11T01:27:01+00:00
ID
Thread
Re: DOCBOOK: Question regarding DocBook for SGML and XML
"Noble, Benjamin, ALEAT" <> writes:

> From my understanding, the DocBook DTD for SGML defines the same set
> of elements and structure as the DocBook DTD for XML; only one is for
> SGML and the other for XML. Is this correct?

It defines the same elements, and mostly the same content models for
those elements, with the biggest difference being that the SGML DTD
contains SGML exclusions in some content models -- for example, the
SGML DTD excludes <footnote> as a descendent of <footnote>, because it
doesn't make much practical sense to have footnotes within footnotes.

XML DTDs can't contain exclusions, so if you're authoring using the
DocBook XML DTD, it's possible to produce documents containing some
valid-but-not-logical markup like footnotes within footnotes.

Appendix B.1 of "DocBook: The Definitive Guide" has details about some
other differences.

  http://www.oreilly.com/catalog/docbook/chapter/book/appb.html#S-DOCBOOKXML

> Moreover, if I create a DocBook SGML document, how close is it to a
> DocBook XML document? I imagine that, with some
> modifications/limitations to the SGML document, I'll have a DocBook
> XML document (just need to change the DOCTYPE).

For that, take a look at Appendix B.2, "DocBook Instances as XML":

  http://www.oreilly.com/catalog/docbook/chapter/book/appb.html#AEN148542

You should be able to run James Clark's "sx" utility on your SGML doc
instances to convert them to XML.

 http://www.jclark.com/sp/sx.htm

You might also need to run his "sgmlnorm" on them first.

 http://www.jclark.com/sp/sgmlnorm.htm

Hey DaveP, this is probably a good one for the FAQ.

  --Mike

-- 
Michael Smith                                      
---------------------------------------------------------------------
17F Shinjuku Square Tower Bldg         +81 90 6175 6931 (mobile)    
6-22-1 Nishishinjuku                   +81  3 5909 6347 (office)    
Shinjuku-ku, Tokyo, Japan 163-1129     +81  3 5909 6241 (fax)

DocBook Technical Committee member     xmlhack contributing editor  
http://www.oasis-open.org/docbook/     http://xmlhack.com/          
                                    
DocBook Open Repository member         xml-doc mailing list moderator 
http://docbook-sourceforge.net/        http://xml-doc.org/          
                                    
Logopoeia Web knob twister             http://www.logopoeia.com/
---------------------------------------------------------------------
Next in thread → Next in month →