This is the mail archive of the mailing list for the DocBook project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: 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.

> 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":

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

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

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


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          
DocBook Open Repository member         xml-doc mailing list moderator          
Logopoeia Web knob twister   

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]