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]

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


Am Mittwoch, 11. September 2002 05:30 schrieb Matt G.:
> From: Janning Vygen <vygen@gmx.de>
>
> >To: Ljósálfr <fjolsvit@netscape.net>, docbook@lists.oasis-open.org
> >
> >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.

ok, you are right in this point. If i include a fiel a lots of time 
with XInclude and ichange its location i have to change the url in 
every href attribute of XInclude.

Question: Can I use XMLCatalog with XInclude. Dont know much about 
XMLCatalogs but i think you can do a url to filename mapping with it. 
If xou could use it together with XInclude then you get back the 
"level of indirection"

Another important advantage of XInclude is the possibility to put 
doctype declaration in the modular doc to validate it seperatly from 
the main document AND you can use entites in each file which is not 
possible within external entities. 

And take a look at the powerful combination to use XInclude together 
with XPath to include just parts which match the XPath expression.

kind regards,
janning

> 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


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