1

i'm trying to use the ubuntu cli version of xalan:

Xalan version 1.10.0
Xerces version 2.8.0

My problem is how to kick in with date functions. I tryed like this:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:date="http://exslt.org/dates-and-times" extension-element-prefixes="date">

<xsl:import href="date/date.xsl" />
<xsl:output method="text" indent="yes" />
date: <xsl:value-of select="date:date()" />
</xsl:stylesheet>

It gives me back this message:

XSLException Type is: XalanXPathException
Message is: The function number 'http://exslt.org/dates-and-times:date' is not available. (file:///home/user/test.xsl, line x, column y)

What files or what do i need to change to make those date functions work?

4

3 回答 3

2

您需要使用更高版本的 Xalan

来自Xalan J.2.7.1 文档

EXSLT 扩展

Xalan-Java 支持 EXSLT 倡议以向 XSLT 用户提供一组标准扩展功能和元素。Xalan-Java 包括以下 EXSLT 扩展模块的实现:

EXSLT 常用函数 EXSLT 数学函数 EXSLT 集合函数

EXSLT 日期和时间函数

EXSLT 动态函数

EXSLT 字符串函数

EXSLT func:function 和 func:result 元素(请参阅 EXSLT - func:function)

于 2011-01-04T13:53:41.943 回答
1

该文档显示它具有该子集的内置 beta 实现,但是它并没有说您不能从 exslt.org 导入和使用这些函数。为什么你不能?Xalan-c++ 不支持导入函数吗?

请注意,我能够使模板正常工作。只是没有功能。

于 2011-08-28T20:05:15.467 回答
0

来自http://xml.apache.org/xalan-c/extensionslib.html

Xalan-C++ 包括四个 EXSLT 命名空间中的函数的 beta 实现(一些是对 Xalan 命名空间中已经存在的扩展的调用)。

http://xml.apache.org/xalan-c/apiDocs/XalanEXSLTDateTimeImpl_8hpp.html看来,它似乎只date:date-time()被实现了。

于 2011-01-04T17:40:36.483 回答