This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
[docbook-apps] Re: [docbook] Best practices for external entity references?
- From: "Sina K. Heshmati" <sina at khakbaz dot com>
- To: "Chris Johnson" <cjohnson at capcollege dot bc dot ca>,<docbook-apps at lists dot oasis-open dot org>
- Date: Tue, 13 Apr 2004 16:14:44 +0200
- Subject: [docbook-apps] Re: [docbook] Best practices for external entity references?
- References: <s072bfbb.098@hermes.capcollege.bc.ca>
Chris,
The way I deal with identical cases is to create an entity file
('ent/repository.ent') and direct all entity references to it. For example,
you have several XML source files (DocBook doctype in this case); you should
have something like this:
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY % repository SYSTEM "ent/repository.ent">
%repository;
]>
<section id="entRepository">
<title>This is a test!</title>
<para>Entity Repository Test</para>
...
</section>
on the top of each one. So that, all entity references will be resolved
using 'ent/repository.ent'.
I recently examined this method on DocBook Website sources with 'webpage'
doctype. You might find them helpful.
[1]. http://www.khakbaz.com/javad/misc/humor/index.xml
This is an XML source that calls a parameter entity after doctype
declaration.
[2]. http://www.khakbaz.com/javad/ent/
This directory contains all entity files I have defined.
Note that, you definitely need an entity resolver while processing your
source files.
Sina
----- Original Message -----
From: Chris Johnson
To: docbook@lists.oasis-open.org
Sent: Tuesday, April 06, 2004 11:33 PM
Subject: [docbook] Best practices for external entity references?
Hi,
I am assembling the portions of a modular docBook document, and was
wondering if here are any resources for best practices for using entity
references.
Each section file (meaning the root element is a <section> element)
will reference one or more outcomes, course lists, and / or general
entities, and I would like to manage these entities as centrally as
possible.
I have Elliotte Harold's XML Bible and have googled this topic, and
have come up with two possibilities:
1) Use an 'index' file to point to other files that contain the actual
entity references:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
[
<!ENTITY % ENT_INDEX SYSTEM "../entities/entity_index.dtd">
%ENT_INDEX;
]>
2) Refer to each external parameter entity as required:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
[
<!ENTITY % GENERAL SYSTEM "../entities/general.dtd">
%GENERAL;
<!ENTITY % OUTCOMES SYSTEM "../entities/outcomes.dtd">
%OUTCOMES;
<!ENTITY % COURSELISTS SYSTEM "../entities/courselists.dtd">
%COURSELISTS;
]>
Any thoughts on 1) vs. 2), or on this method in general? I'm leaning
towards 1), as I can then add other entity sets if needed to
entity_index.dtd. Also, are there any gotchas regarding addressing
(relative / absolute / fully resolved)? Should I be looking at using
Catalogs?
I have attached copies of the entity files, and I look forward to your
feedback.
TIA,
Chris
Chris Johnson
Web Developer
Capilano College
North Vancouver, Canada
604.986.1911 ext. 3455
cjohnson@capcollege.bc.ca
To unsubscribe from this list, send a post to
docbook-unsubscribe@lists.oasis-open.org, or visit
http://www.oasis-open.org/mlmanage/.
To unsubscribe from this list, send a post to docbook-apps-unsubscribe@lists.oasis-open.org, or visit http://www.oasis-open.org/mlmanage/.