At 2002-10-09 13:49 -0400, Whitney, Dan (FPDG) wrote:
>Although probably not a discussion for this group, just have to ask why is
>using external entities not a good idea?
Sorry, I didn't quite say that ... I said they were not a good idea for
I think they are a great idea and I use external parsed general entities
extensively on a daily basis with very successful results in the very long
My XSLT training material is made up of 37 separately authored XML external
parsed general entities (at approximately a module and lesson granularity).
My XSL-FO training material is made up of hundreds of external parsed
general entities, most of which are synthesized from other XML instances.
External parsed general entities are *wonderful* for managing a large
single XML file as many separately editable system resources ... I keep all
of my authored entities and "seed" documents (the ones I use to synthesize
the hundreds of little entities) separately in my source code control system.
Note that I said "single XML file".
>What is the long term danger?
The susceptibility of the parsing context ... the collection of entities
used by the fragments of the XML document. Part of the DTD is found in the
internal declaration subset and impacts on all of the fragments.
Consider (and I've seen this) a shop using shared XML information in
external parsed general entities. It works for months and everyone is
happy. Someone changes the shared entity to refer to a new entity and
updates their internal declaration subset of their XML, or their version of
the DTD (that may not be shared) to define the entity so that their XML
document is well-formed.
Instantly, *every* other XML document sharing that fragment is now not
well-formed because of the missing definition for the entity ... and since
it isn't even well-formed, XML-based tools reject the instance (as it
should!) instead of doing any kind of partial processing.
With this in mind, I am very wary of sharing entities, though I have done
so in a *very* limited and controlled fashion.
In my own presentation environment I have slides shared between different
presentations, and the authoring of presentations isn't as controlled. I
don't use external parsed general entities to share a common slide, I use
the document() function and the id() function to reach into an wholly
contained XML document (that may be made up of multiple entities) and
access the slide from the node tree (not the syntax of the entity) of the
This way every presentation, regardless of how many fragments each is made
up of, is accessed only as a wholly contained XML document and my authoring
process for each presentation ensures they are self-consistent, without
needing to worry about what other presentations might be sharing.
I hope this helps.
G. Ken Holman mailto:gkholman@...
Crane Softwrights Ltd. http://www.CraneSoftwrights.com/f/
Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
ISBN 0-13-065196-6 Definitive XSLT and XPath
ISBN 0-13-140374-5 Definitive XSL-FO
ISBN 1-894049-08-X Practical Transformation Using XSLT and XPath
ISBN 1-894049-10-1 Practical Formatting Using XSL-FO
Next public training: 2002-12-08,2003-02-03,06,03-03,06