This is the mail archive of the docbook@lists.oasis-open.org 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]

XInclude vs. external entities (Re: The best way to 'include'parts...)


From: Janning Vygen <vygen@gmx.de>
To: Ljósálfr <fjolsvit@netscape.net>, docbook@lists.oasis-open.org
Subject: Re: DOCBOOK: The best way to 'include' parts of a DocBook
Date: Tue, 10 Sep 2002 17:52:02 +0200

I use XInclude all the time and by now i see no disadvantage over external entities.
The advantages of entities derive from the fact that the mechanism provides a level of indirection - the name of a chunk is decoupled from its address. Indirection carries a fundamental tradeoff of locality vs. centralized management (e.g. you must define an entity, before you can use it, but the <!ENTITY ...> declaration has the advantage that by centralizing this mapping, the address of a chunk can be changed in a single place). Also, indirection carries with it the potential to override the address (or even the value, in the case of entities), or for it to be externally specified.

One of my favorite techniques is for a document chunk (itself an entity) to reference entities it (i.e. its mating external parameter entity) doesn't define (or that it does define, but which the parent overrides). This allows reusable content that is customizable by the parent, and can be used with entities as small as a term (e.g. a product name) to ones as large as figures, tables, paragraphs, whole document chunks, etc.


I don't mean to imply that XInclude is bad - it probably serves as a suitable replacement for external entities, most of the time. The primary benefit is that it's conceptually and functionally simpler. However, I wanted to cite some usage models you (and other XInclude advocates) may have been overlooking.

The external entity facility is a powerful tool in structuring modular documentation - one which I'd never willingly give up.


Matt Gruenke


_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. http://www.hotmail.com


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