atom feed6 messages in org.oasis-open.lists.docbookRe: DOCBOOK: where to store entity re...
FromSent OnAttachments
Erik PriceJul 12, 2002 11:52 am 
Robert McIlvrideJul 12, 2002 12:33 pm 
Robert McIlvrideJul 12, 2002 12:43 pm 
Norman WalshJul 12, 2002 12:53 pm 
Bob StaytonJul 12, 2002 12:54 pm 
Erik PriceJul 12, 2002 1:14 pm 
Subject:Re: DOCBOOK: where to store entity references
From:Bob Stayton (bo@caldera.com)
Date:Jul 12, 2002 12:54:07 pm
List:org.oasis-open.lists.docbook

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.