XInclude在XSLT样式表中(eXist db)

XInclude在XSLT样式表中(eXist db),xslt,exist-db,xinclude,Xslt,Exist Db,Xinclude,我的一些样式表有点大,它们的一些部分是重复的。我想为它们使用XInclude,这将允许我将它们分离到整个样式表之外。我不能在这里使用xsl:import或xsl:include,因为我需要将它们插入到生成书签和活动链接(用于xsl-FO)的特定位置 如果我使用: <xi:include href="/db/apps/tested-bunny/resources/xsl-fo/common/bookmark-tree.xml/> 如果我尝试在XSL样式表的形式中包含相同的代码片段,它

我的一些样式表有点大,它们的一些部分是重复的。我想为它们使用XInclude,这将允许我将它们分离到整个样式表之外。我不能在这里使用
xsl:import
xsl:include
,因为我需要将它们插入到生成书签和活动链接(用于xsl-FO)的特定位置

如果我使用:

<xi:include href="/db/apps/tested-bunny/resources/xsl-fo/common/bookmark-tree.xml/>
如果我尝试在XSL样式表的形式中包含相同的代码片段,它与正确注入的代码片段相同,但它没有将其功能添加到整个样式表中,它仍然没有被翻译


是否有我不知道的具体做法或限制?如何正确地做到这一点?

对于我来说,工作解决方案不是XInclude,而是
xsl:include
并在适当的时间调用模板:

...
</fo:declarations>
<!-- Bookmarks from the external stylesheet -->
<xsl:call-template name="bookmark-tree"/>
<fo:page-sequence master-reference="title-page">
...
。。。
...
我创建了正确的样式表。重要的是将根元素设置为当前上下文:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="2.0">
    <xsl:template name="bookmark-tree" match=".">
        <fo:bookmark-tree>
            ...

...
当然,有必要将样式表包含到我称之为模板的样式表中:

<xsl:include href="common/bookmark-tree.xsl"/>


现在,我认为这个问题是回答的。

,对于我来说,工作解决方案不是xCube,而是<代码> XSL:包含并在适当的时候调用模板:

...
</fo:declarations>
<!-- Bookmarks from the external stylesheet -->
<xsl:call-template name="bookmark-tree"/>
<fo:page-sequence master-reference="title-page">
...
。。。
...
我创建了正确的样式表。重要的是将根元素设置为当前上下文:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="2.0">
    <xsl:template name="bookmark-tree" match=".">
        <fo:bookmark-tree>
            ...

...
当然,有必要将样式表包含到我称之为模板的样式表中:

<xsl:include href="common/bookmark-tree.xsl"/>

现在,我认为这个问题是回答的。