This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


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

Re: Docbook XML - including files


> From: Yann Dirson <ydirson@alcove.fr>
> 
> On Wed, Aug 01, 2001 at 10:33:52AM -0700, Bob Stayton wrote:
> > > <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
> > > "docbookx.dtd" [
> > > <!ENTITY % foo SYSTEM "foo.xml">
> > > <!ENTITY bar SYSTEM "bar.xml">
> > > %foo;
> > > ]>
> > > &bar;
> > 
> > Could you clarify this solution a bit?  8^)
> > If foo.xml is as Robert describes, then I think this will
> > fail.  That is, if foo.xml contains <!ENTITY> declarations
> > for individual section files, as well as references to
> > those entities (as Robert said he was trying to do), then
> > this example puts the section content into the DTD (above
> > the closing ]> in the example).
> 
> I don't know how to have foo.xml cannot contain both the entity
> declarations and references.  My example only works if foo.xml
> contains only entity declarations, that you can reference in your
> document afterwards (basically making foo.xml a library of entities).

OK, that's what I thought you meant.
It nicely illustrates the problem of trying to do modular
XML files.  All system entities must be declared
in the DTD (in the internal or external subset), and
a document can have only one DOCTYPE declaration.
So the modular files can't have their own DOCTYPE
to declare their own submodules as Robert wanted
to do.  Your solution is a good way to manage
the declarations outside of the main DOCTYPE
declaration.

This issue of a single DOCTYPE comes up again when you try
to edit the modular files (the system entities). I would
prefer to use a validating editor that loads the DTD when
editing a modular file.  But I can't hsve a DOCTYPE
declaration in the modular file to identify the DTD.
If I add it, then the parse of the main document
fails when the modular file is read as a system entity.
 
> >  I don't think that is what
> > you intended.  I think you mean to separate the <!ENTITY>
> > declarations for the sections into foo.xml, and the
> > references to those entities in bar.xml, no?
> 
> That's not what I meant (I basically just modified a bit the original
> example), but that would be doable I think (untested).
> 
> Another approach I think of would be to use sub-documents, but I don't
> really know what this concept is about yet, and don't know whether XML
> supports this SGML concept.  Does someone has any clues about that ?

XML does not support sub-documents.

However, the long term solution in XML will be XInclude,
which is currently in the Working Draft stage at W3C:

http://www.w3.org/TR/xinclude/

That looks like it will support the kind of modular
file inclusion that's described here.  But I
guess we had better read it and comment to make 
sure it works!

bobs
Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
Caldera International, Inc.                 fax:   (831) 429-1887
                                            email: bobs@caldera.com

------------------------------------------------------------------
To unsubscribe from this elist send a message with the single word
"unsubscribe" in the body to: docbook-apps-request@lists.oasis-open.org


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