Return-Path: Delivered-To: apmail-forrest-dev-archive@www.apache.org Received: (qmail 14221 invoked from network); 8 Sep 2006 11:21:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Sep 2006 11:21:55 -0000 Received: (qmail 90083 invoked by uid 500); 8 Sep 2006 11:21:44 -0000 Delivered-To: apmail-forrest-dev-archive@forrest.apache.org Received: (qmail 90051 invoked by uid 500); 8 Sep 2006 11:21:44 -0000 Mailing-List: contact dev-help@forrest.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@forrest.apache.org List-Id: Delivered-To: mailing list dev@forrest.apache.org Received: (qmail 90029 invoked by uid 99); 8 Sep 2006 11:21:44 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Sep 2006 04:21:44 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [212.23.3.141] (HELO heisenberg.zen.co.uk) (212.23.3.141) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Sep 2006 04:21:37 -0700 Received: from [217.155.85.142] (helo=[217.155.85.140]) by heisenberg.zen.co.uk with esmtp (Exim 4.50) id 1GLeQ7-0002dN-Gg for dev@forrest.apache.org; Fri, 08 Sep 2006 11:21:15 +0000 Message-ID: <45015229.9070400@apache.org> Date: Fri, 08 Sep 2006 12:21:13 +0100 From: Ross Gardler User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: dev@forrest.apache.org Subject: Re: xinclude References: <6212b1d00606290824p5557e258q7d878c14d62cd89f@mail.gmail.com> <1151595390.8177.39.camel@localhost.localdomain> <44FB3B5C.80808@apache.org> <44FBE573.2010609@apache.org> <1157552352.8095.12.camel@localhost.localdomain> <44FEEBDA.8030305@apache.org> <45013DD7.4070909@apache.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Originating-Heisenberg-IP: [217.155.85.142] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Jim Dixon wrote: > On Fri, 8 Sep 2006, Ross Gardler wrote: > > >>>------------------------------------------------------------------------- >>> >>>>> "-//APACHE//ENTITIES Documentation V2.0//EN" >>> "document-v20.dtd"> >>>%document; >>> >>>>> xmlns:xi CDATA #FIXED "http://www.w3.org/2001/XInclude" >>> >>> >>>>> parse (text|xml) "xml" >>> href CDATA #REQUIRED >>> encoding CDATA #IMPLIED >>> >>>------------------------------------------------------------------------- >>> >>>This works for my purposes. I enable XInclusion by using this doctype >>>instead of document-v20.dtd. >>> >>>If this were to be done as a patch, I suppose the patch would introduce >>>a new doctype V2.1, with the xi:include element moved into what would now >>>be document-v21.mod. This would be added to catalog.xcat. >> >>I don't think we need to create a version 2.1 for this to be honest. I >>know we *should* but it is an optional element that is 100% backward >>compatible. >> >>Can we just slip it in without causing any upset? Naughty I know, but I >>don't have the time to do a "proper job" on this. >> >> >>>The exact place(s) where the xi:include element would be permitted might >>>be an issue to some. I would add it to link-content.mix. > > > I've thought about this a bit more. One of the problems here is that > adding xi:include elements has unexpected results. > > If the DTD is extended as above, then the validator will, I think, not > check beyond the xi:include element, and so a document may validate > even though what is being XIncluded is nonsense. I can write >

> and validation will succeed, because the xi:include element has the > pattern required by the DTD even though rubbish.xml isn't XML at all Good point. > The expected behavior is that the validator recognizes that what is being > XIncluded is XML (as it is by default) and goes through to validate that > as well, silently replacing the xi:include element with whatever is > XIncluded. I think that some parsers do this - perhaps only if an > option is set - but most don't. Does Xalan do it? This is the default parser for Forrest. A healthy warning in the docs and output of the validate task may be sufficient for those using a different parser. > A better approach would be to process the XIncludes before validation, > stripping off the xlmns:xi attribute from the document element and > replacing xi:includes with whatever they resolve to. This should be > cheaper than it might seem: unless the xmlns:xi is present, the > document is simply handed on to the validator untouched. I can't see an easy way of doing this as, in many cases, the included content is generated by Forrest. In fact, this would be a problem if the parser were doing the includes. Ross