Kevin Flynn wrote: > I am trying to modify our configuration to take advantage of XmlMind > 4.x's support of XML catalogs for Xincluded documents. > > I have an XML catalog that contains the definition: > > <rewriteURI uriStartString="ece-global:" rewritePrefix="./variables/" /> > > This means that I can put Xincludes in my documents as follows: > > <xi:include href="ece-global:global-variables.ebk" xpointer="g-studio" /> > > And the referenced element "g-studio" is included from the file > ./variables/global-variables.ebk (where '.' is the location of my > catalog.xml file). > > So far so good... > > My problem is, how do I insert > > <xi:include href="ece-global:global-variables.ebk" xpointer="g-studio" /> > > into a document? > > I tried the following in my "insert variable" macro: > > <command name="include" parameter="replace > ece-global:global-variables.ebk %_"/> > > but it doesn't work - the inclusion is not carried out. Does the include > function parse the referenced_document_URL parameter but not support > catalogs? >
Currently, the include command is strictly the functional equivalent of the Include tool. The Include tool does not support specifying URIs resolved by an XML catalog (e.g. "ece-global:global-variables.ebk"), therefore it is the same for the include command. It is very easy to modify the include command to make it use XML catalogs when parsing its referenced_document_URL argument ( http://www.xmlmind.com/xmleditor/_distrib/doc/commands/include.html ). I did that in 2 minutes and it works fine. Unfortunately, when you'll save your document, you'll not find: <xi:include href="ece-global:global-variables.ebk" xpointer="g-studio"/> but something like: <xi:include href="file://home/kevin/doc/global-variables.ebk" xpointer="g-studio"/> That is, a reference to the resolved URL, and not to the original URI. Of course, this defeats the whole idea of using an XML catalog in this context. We'll try to remove this limitation in next release. (I'm saying we'll try because we think that this will not be easy.)

