Page 1 of 1

Xinclude a document with a different namespace

Posted: Mon Oct 01, 2007 7:20 pm
by Zearin
Okay, I have a Docbook 5 RC5 file that validates. Inside this document I have an XInclude element that references another XML document. This second document, however, has a different namespace and element structure. This document has a custom schema that I wrote.

After some searching I added the xi:fallback element and discovered that the included document is not being properly included. (At least, the fallback element is being output when I transform the Docbook file to HTML.)

What can I do to repair this failed XInclude?

Posted: Tue Oct 02, 2007 10:39 am
by sorin_ristache
Hello,

If the document specified in the href attribute of the xi:include element is not included then you should check that you have XInclude enabled in Options -> Preferences -> XML -> XML Parser -- XInclude Options. If it is enabled please post some sample files that show the problem.


Regards,
Sorin

In Ant.

Posted: Tue Oct 02, 2007 3:20 pm
by Zearin
Yep.

I forgot to mention that I'm performing the transformation using an Ant buildfile. XInclude works fine using Oxygen's built-in Transform feature, but XInclude is not functional when performing the transformation with Ant (which works just fine otherwise).

Using Ant v1.7 (latest from fink).

I discovered the following workaround:

Code: Select all


<xsl:template match="xi:include" xmlns:xi="http://www.w3.org/2001/XInclude">
<xsl:apply-templates select="document(@href)/*" />
</xsl:template>
Seems to work for now, but I would like to see if I can get things to work as intended without any workarounds.