This is the mail archive of the
mailing list for the DocBook project.
Re: external entities cannot be valid?
- To: docbook at lists dot oasis-open dot org
- Subject: Re: DOCBOOK: external entities cannot be valid?
- From: Terry Allen <tallen at sonic dot net>
- Date: Tue, 29 Feb 2000 09:03:58 -0800
- Reply-To: docbook at lists dot oasis-open dot org
| >> / Bob Stayton <email@example.com> was heard to say:
| >> | It appears that external parsed entities cannot be
| >> | valid XML. Someone please prove me wrong.
| > To which Norm Walsh <firstname.lastname@example.org> replied:
| > Uh, I'm not sure what you mean.
| > A document that uses external
| > parsed entities can certainly be valid.
| Yes, the document using the entity can be valid, but
| I was referring to the external parsed entity itself,
| the included XML file.
Ah, well then. No, it can only be well formed, but you
can test by parsing to see that it would be valid on its own given
an appropriate doctype declaration. And you can of course
test by parsing that it is valid in the context of its inclusion.
| It's cold comfort that you couldn't do valid
| modular files in SGML either. I thought XML was
| the *improved* version of SGML. 8^)
You didn't hear me say that ... but then XML has given
you the concept of well formedness ...
| Quoting the XML 1.0 spec (section 4.4.3):
| "... the automatic inclusion provided by the SGML and XML entity
| mechanism, primarily designed to support modularity in
| authoring, ..."
| So the mechanism partially supports modularity if you
| create the rest of the solution yourself.
Yes. Now you might want to look at the new Xlink spec,
which I've read only quickly, and see if the semantics of
"show" are sufficiently well described that you could
do what you really want to using some (uninvented?)
software that implements Xlink.
That is, can a resource that is "shown" have a doctype
declaration? and what are the processing expectations
for rendering it as an inclusion? (I think the answers
are "we don't say" and "nothing specific", but I'm not
a member of the Xlink WG.)
| > Option C is very troublesome to implement.
| Ack, you are right, making a chapter wrapper file an entity
| reference to the whole content does not work, but I don't
| see why. I presume this is because the root element of a
| valid document must be in the document before the external
| entities are processed. But I looked through the spec but
| could not find where this type of usage is not allowed.
It was so in SGML, so for compatibility it must be so in XML;
perhaps they didn't say so specifically; you might check the
errata. Remember, XML is only an application of SGML, however
much some in the W3C might like to think differently.
| BTW, I took a look at xinclude, and its current discussion
| of validation of merged content is a bit troublesome.
| Statements like make me wonder a bit:
| "NOTE: The DTD or Schema used for validation
| may need to be adjusted when running a particular document
| through an XML processor instead of a XInclude processor. A
| validating XInclude document is not necessarily a validating
| XML document, and vice versa." I'll have to study it
| some more to see if it will solve the problem in the
| long run.