This is the mail archive of the
docbook@lists.oasis-open.org
mailing list for the DocBook project.
Re: where to store entity references
- From: Bob Stayton <bobs at caldera dot com>
- To: Erik Price <pricee at hhbrown dot com>, docbook at lists dot oasis-open dot org
- Date: Fri, 12 Jul 2002 12:53:51 -0700
- Subject: Re: DOCBOOK: where to store entity references
- References: <DBFC1C91-95C8-11D6-95D5-0050E4857868@hhbrown.com>
On Fri, Jul 12, 2002 at 02:54:56PM -0400, Erik Price wrote:
> I have two more (hopefully easy) questions...
>
> I have a large file of internal general entity references that I have
> made to save myself the trouble of hand-typing the same markup for
> certain items in my documents that are repeated in many places. This is
> (AFAICT) the custom.
>
> But I also have a few dozen external general entity references, which I
> am using in imitation of the examples in "DocBook: The Definitive
> Guide" -- each of my "sect1" elements is in its own file (for ease of
> maintenance). I have one "master" file, called "documentation.xml",
> which consists of little more than a hierarchy of "book"s, "part"s, and
> "chapter"s, and an external general entity reference within each chapter
> for each "sect1" element. In other words, this file has the structure,
> whereas the subfiles have all of the meat.
>
> Since I am not including an internal DTD (rather I am using the DocBook
> DTD), I haven't made any entity declarations in my document yet. I am
> assuming that I can do them within the system identifier, like this:
>
> <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
> "system.identifier"
> [
> <!ENTITY ent1 SYSTEM "path/to/file">
> <!ENTITY ent2 SYSTEM "path/to/file">
> <!ENTITY ent3 SYSTEM "path/to/file">
> ]
> >
>
> Instead of putting all of the entities directly at this point, can I
> just keep them in their separate file and declare an entity reference to
> the file full of entity declarations? Like this:
>
> <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
> "system.identifier"
> [
> <!ENTITY entityfile SYSTEM "path/to/file">
> &entityfile;
> ]
> >
>
> Now will all of my entities (in that file) be "included" into the
> document?
Yes, you can do this, but it must be with a parameter
entity, which is used for entity references
within the DTD:
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"system.identifier"
[
<!ENTITY % entityfile SYSTEM "path/to/file">
%entityfile;
]
>
>
> The other question I have is, can I specify a relative path to a file in
> an external general entity reference? Like above? Or should it start
> with "./path/to/file" to indicate "current working directory"?
>
> Or must those paths be absolute?
Relative is ok.
--
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