我正在尝试使用xalan的ubuntu cli版本:
Xalan version 1.10.0
Xerces version 2.8.0我的问题是如何使用日期函数。我试着这样做:
<?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>它给我返回了这样的信息:
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)我需要更改哪些文件或哪些内容才能使这些日期函数工作?
发布于 2011-01-05 01:40:36
来自http://xml.apache.org/xalan-c/extensionslib.html
EXSLT C++包括四个
名称空间中的函数的beta实现(其中一些是对Xalan名称空间中已有的扩展的调用)。
从http://xml.apache.org/xalan-c/apiDocs/XalanEXSLTDateTimeImpl_8hpp.html上看,似乎只实现了date:date-time()。
发布于 2011-01-04 21:53:42
Xalan您需要使用更新版本的。
从
EXSLT扩展
Java
支持向XSLT用户提供一组标准扩展函数和元素的计划。Xalan-Java包括以下EXSLT扩展模块的实现:
EXSLT公共函数EXSLT数学函数EXSLT集合函数
EXSLT日期和时间函数
EXSLT动态函数
EXSLT字符串函数
EXSLT func:function和func:result元素(参见EXSLT - func:function)
发布于 2011-08-29 04:05:15
文档显示它有针对该子集的内置beta实现,但它并没有说您不能从exslt.org导入和使用这些函数。为什么你不能呢?Xalan-c++不支持导入函数吗?
请注意,我能够让模板正常工作。只是不是函数。
https://stackoverflow.com/questions/4593690
复制相似问题