forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <je...@apache.org>
Subject Re: Xinclude and (in)validation
Date Thu, 06 Feb 2003 01:34:12 GMT
On Thu, Feb 06, 2003 at 01:20:28AM +0100, Nicola Ken Barozzi wrote:
> Replying myself. Found a doc that explains it.
> http://www.xml.com/pub/a/2002/07/31/xinclude.html?page=2
...
> > How the heck is 
> >xinclude to work in the real world with validation?
> 
> Relevant answer in the above cited doc:
> "
> One of the most common questions about XInclude is how inclusion 
> interacts with validation, XSL transformation, and other processes that 
> may be applied to an XML document. The short answer is that it doesn't. 
> XInclusion is not part of any other XML process. It is a separate step 
> which you may or may not perform when and where it is useful to you.
> 
> For example, consider validation against a schema. A document can be 
> validated before inclusion, after inclusion, or both. If you validate 
> the document before the xi:include elements are replaced, then the 
> schema has to declare the xi:include elements just like it would declare 
> any other element. If you validate the document after the xi:include 
> elements are replaced, then the schema has to declare the replacement 
> elements. Inclusion and validation are separate, orthogonal processes 
> that can be performed in any order which is convenient in the local 
> environment.
> "
> 
> So, since I want xinclude functionality to be present, also because I 
> imagine that we can xinclude parts of site.xml to generate consistent 
> multi-project sites, how are we going to solve this?
> 
> Possibility: plug in an xinclude step before the validation. There is an 
> xinclude task somewhere, if not we can make it.

Problem is, whatever tool does the xinclude preprocessing will need to
use a parser, and when that parser encounters the DOCTYPE declaration it
will try to validate the XML :)

That is, unless the xinclude tool uses XNI directly, or fiddles with the
bytestream before and after parsing:

http://doctypechanger.sourceforge.net/


I think the best solution is to modify the DTD to allow xi:include.  The
Docbook book has some info on this process:

http://docbook.org/tdg/en/html/ch05.html

I don't think there are any better solutions, so long as we're hanging
onto DTDs.  Even the latest version of Docbook has declared SVG, MathML
and HTML forms in the DTD, rather than abandon DTDs altogether.


--Jeff

> Dunno, I'm going to sleep now, maybe tomorrow it will be clearer 8-)
> 

Mime
View raw message