Tomas HAJEK wrote:
> 
> I would like to react on a message from April this year, where catalog 
> usage in resolving XIncludes hrefs is discussed:
> 
>> Barbara Estes wrote:
>> >/ I updated standard XXE-Editor from version 2.7 to 3.2.  I had edited the
>> />/ XXE-Editor catalog previously to rewrite URI's for use with xi:included
>> />/ files.  I edited the catalog with the new version to include my rewrite
>> />/ URI paths but it is not happening.  It is throwing errors saying the
>> />/ path cannot be found.
>> />/ 
>> />/ After the standard rewriteURI that comes in the catalog (shown below), I
>> />/ added the following:
>> />/  <rewriteURI uriStartString="xxe-config:" rewritePrefix="." />
>> />/  <rewriteURI uriStartString="file:///core/" <file:///core/%22>
>> />/ rewritePrefix="file:///E:/wip/core/help/" <file:///E:/wip/core/help/%22> 
>> />
>> />/  <rewriteURI uriStartString="file:///gen/" <file:///gen/%22>
>> />/ rewritePrefix="file:///E:/wip/gen/help/" <file:///E:/wip/gen/help/%22> />
>> />/ 
>> />/ When I load the file in XXE-Editor, I get the following warning message:
>> />/ /chapter/sect1/xi:include:
>> />/ cannot load file "\core\generic\genericText.xml":
>> />/ \core\generic\genericText.xml (The system cannot find the path specified)
>> />/ 
>> />/ In the file, the xi:include looks like this:
>> />/ 
>> />/ <xi:include href="file:///core/generic/genericText.xml" 
>> <file:///core/generic/genericText.xml%22>
>> />/ xpointer="genericText_configuration"
>> />/ xmlns:xi="http://www.w3.org/2001/XInclude"; 
>> <http://www.w3.org/2001/XInclude%22>>
>> />/    </xi:include>
>> />/ 
>> />/ So why did this work before, but will not work now.  I can't figure it 
>> out.
>> />/ 
>> /
>> What you did is OK, and the XML Catalog works fine in XXE, but starting
>> from version V2.8 Patch 1 (November 29, 2004), *xi:includes* are no
>> longer XML Catalog enabled. (Yes, this is a regression.)
>>
>> Why?
>>
>> - "File|Save As" cannot handle modular documents where an XML catalog is
>> used to resolve the locations found in the href attribute of xi:include.
>>   
> How is the "Save as" working? When I tried to save modular document with 
> this command, it saves unexpanded <xi:include> elements normally, which 
> is expected behaviour. I can imagine, that when resolving the includes 
> (for document rendering in the editor), catalog could be used. Anyway, 
> the included parts are not directly editable. When saving the document, 
> original <xi:include> elements could be saved again 
> (catalog-unresolved), so where is the problem with "Save as"?

I'm sorry but what I've said previously is still true. If we could 
really support XML Catalog for <xi:include> href, we would have done it.



>> - xi:includes are supposed to be used *internally* by XXE to create
>> modular documents. In such case, the fact that xi:includes are not XML
>> Catalog enabled is not a problem.
> Yes, but catalog resolving makes modularity far more powerful. I know 
> that inserting <xi:include> by commands Paste as reference available in 
> XXE now provide no mechanism how to insert arbitrary XInclude. But one 
> could suppose that there are also other XML file sources with XIncludes. 
> Not all documents are created using XXE.

The situation has changed. As of V3.3, you can insert arbitrary 
XIncludes elements using XXE.

But for that you need to do two things:

[1] Customize your DTD, W3C XML Schema or RELAX NG schema to declare the 
<xi:include> element wherever you need it.

[2] Add this snippet to the XXE configuration file corresponding to the 
customized schema described in [1]:

---
   <!-- Suppress XInclude processing -->
   <inclusionProcessor name="XInclude"/>
---

More info in 
http://www.xmlmind.com/xmleditor/_distrib/doc/configure/inclusionProcessor.html

Please download and install the configuration called "DocBook 5 + 
XInclude configuration" to see how this works.

Of course by doing this, you'll loose the transclusion feature of 
<xi:include> elements which is normally supported by XXE but, at least, 
you'll be able to use the full power of XIncludes (and of course, XML 
Catalogs for <xi:include> href).

I hope that this compromise is acceptable for a power user like you.

Reply via email to