我运行XML Maven插件这个POM片段的
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xml-maven-plugin</artifactId>
<version>1.0.1</version>
<executions>
<execution>
<goals>
<goal>transform</goal>
</goals>
</execution>
</executions>
<configuration>
<transformationSets>
<transformationSet>
<dir>${basedir}/target/xml</dir>
<stylesheet>${basedir}/target/typesetting/fop/xslt/PhotoBook-fo.xslt</stylesheet>
</transformationSet>
</transformationSets>
</configuration>
<dependencies>
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>Saxon-HE</artifactId>
<version>9.7.0-15</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
样式表包含一项功能,<xsl:evaluate>
,这是XSLT 3.0的一部分,我知道这在Saxon-HE 9.7.0中得到了支持。样式表正确声明XSLT版本:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
但处理这个片段:
<xsl:for-each select="xhtml:tr[1]/xhtml:td">
<xsl:element name="table-column" namespace="http://www.w3.org/1999/XSL/Format">
<xsl:attribute name="column-width">
<xsl:evaluate select="@width"/>
</xsl:attribute>
</xsl:element>
</xsl:for-each>
我得到
[INFO] --- xml-maven-plugin:1.0.1:transform (default) @ birds-portfolio-1 ---
Static error at xsl:evaluate on line 132 column 56 of xhtml5-fo.xslt:
XTSE0010: Unknown XSLT element: evaluate
我缺少什么?谢谢。
谢谢,我迷失在各种版本。是的,我确实需要评估,因为我可能会使用一些涉及页面测量的变量来传递表达式(这些内容与排版图书的FOP相关)。我还需要对XSLT代码进行大量的重构,但目前我仍然需要评估,在改进代码的其余部分之前,我必须先处理它。 –