Lists Home |
Date Index |
At 2002-11-10 15:17 -0500, Empowering You wrote:
>I went back and read about entities. I take it that you think I need to
>know General and Parameter, Internal and External entities, right?
These are important for the content of your document and you should
consider them in your information design.
>If a document has a Schema, it can't have a DTD right?
Wrong ... an XML document can always have a DTD because a DTD is part of
the XML 1.0 specification.
The entity part of DTDs is useful for describing your document because you
can express characters and fragments of XML in entities and then refer to
them from within your XML document.
The content models of DTDs won't be useful if you choose to use alternative
modeling technologies such as RELAX-NG or W3C Schema.
Attribute declarations in DTDs are sometimes useful for XSLT (specifically
the declaring of ID-typed attributes).
Note that external parsed general entities are *not* good for sharing
fragments of XML between instances ... I posted some points about this
recently on XML-DEV:
>Can I use entities in an XML document with a Schema without a DTD?
Without DTD models, yes, but you still need that part of DTD syntax that
>Although I now know more about the "pieces and parts" of entities, I
>still am unclear about best-practice uses.
"Best practice" is in the eye of the beholder. I'm a *big* fan of entities
and use external parsed general entities in my book and training material
writing. I choose to author at a lesson or module level so as to not have
to bring in the entire book just to change one area. I also use XSLT so
synthesize entities from reading W3C specifications written in XML, and
then incorporate these synthesized entities as if they had been hand authored.
Some believe entities to be evil.
Unfortunately, Microsoft's MSXML doesn't do correct namespace processing
with external parsed general entities, which has had an impact on some
applications I use (specifically an XSL-FO rendering engine) that is
hardwired to MSXML.
I have to warn my students about this non-conformant behaviour when they
are working with entities and they ask about using Microsoft technology.
>My guess would be that Schemas don't include entities because they knew
>that Xlink, or something like it, would be along. But if that's not the
>case then why aren't entities included in the Schema? Just wondering.
Because entities are processed long before the Schema gets around to
looking at the resulting structure. Entities are part of the syntax of the
XML document and the structure of the document is only to be examined after
entities have been replaced. Schemas only concern themselves with the
structure of the document, not the syntax of the document.
I hope this helps.
Upcoming hands-on in-depth XSLT/XPath and/or XSL-FO:
- North America: Feb 3 - Feb 7,2003
G. Ken Holman mailto:gkholman@CraneSoftwrights.com
Crane Softwrights Ltd. http://www.CraneSoftwrights.com/x/
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 conference training: 2002-12-08,03-03,06