从Java实现时,xsl:result-document标记不起作用

时间:2017-07-18 10:03:23

标签: java-ee xslt-2.0 oxygenxml

我在发布此问题之前提到[stackoverflow] [1],因为我希望向大家提出同样的问题..

我有一个XSLT转换用于使用xsl:result-document创建四个输出当我使用氧气工具运行它时,它创建了所需的输出。但我想从java实现它。已经有saxon方法已经从java实现。 Saxon-HE:9.7.0-14版本 XSLT版本:2

一个文件的示例XSLT:

<xsl:template match="/" mode="aa">
        <xsl:param name="book-name" tunnel="yes"/>

        <xsl:result-document href="{$book-name}.opf"
                             doctype-public="+//ISBN 0-9673008-1-9//DTD OEB 1.2 Package//EN"
                             doctype-system="http://openebook.org/dtds/oeb-1.2/oebpkg12.dtd"
                             indent="yes">

            <xsl:apply-templates mode="#current"/>
        </xsl:result-document>
    </xsl:template>

我不知道为什么这不能用于Java虽然这正在运行纯转换..我需要为此添加外部jar。这不会给我任何错误或输出。

注意: 当我添加xsl:comment或其他标记时,它正在使用Java,我正确地获得了输出。

  • 用于创建一个文件的XSLT

            

        <xsl:call-template name="validate-source-book"/>
    
        <xsl:variable name="pre-processed">
            <xsl:apply-templates mode="pre-processing"/>
        </xsl:variable>
    
        <xsl:variable name="structured">
            <xsl:apply-templates select="$pre-processed" mode="structuring"/>
        </xsl:variable>
    
        <xsl:call-template name="generate-output-files">
            <xsl:with-param name="book-name" select="$book-name" tunnel="yes"/>
            <xsl:with-param name="structured-document" select="$structured"/>
        </xsl:call-template>
    </xsl:template>
    

                 

            

        <xsl:result-document href="{$book-name}.opf"
                             doctype-public="+//ISBN 0-9673008-1-9//DTD OEB 1.2 Package//EN"
                             doctype-system="http://openebook.org/dtds/oeb-1.2/oebpkg12.dtd"
                             indent="yes">
    
            <xsl:apply-templates mode="#current"/>
        </xsl:result-document>
    </xsl:template>
    

提前致谢..!

0 个答案:

没有答案