以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 XSL/XSLT/XSL-FO/CSS 』  (http://bbs.xml.org.cn/list.asp?boardid=8)
----  找了个 exslt 请问这个 xslt 扩展要怎么用的呀?  (http://bbs.xml.org.cn/dispbbs.asp?boardid=8&rootid=&id=52318)


--  作者:redskywy
--  发布时间:9/6/2007 10:33:00 PM

--  找了个 exslt 请问这个 xslt 扩展要怎么用的呀?
http://www.exslt.org
下载了 Dates and Times 扩展,可是不知道怎么用的.
请问这些要怎么用的,可以直接
在 xml 中加入 <?xml-stylesheet href="" type="text/xsl" ?>引用的吗?

--  作者:Qr
--  发布时间:9/7/2007 10:32:00 AM

--  
没看说明。

The namespace for EXSLT - Dates and Times is:

http://exslt.org/dates-and-times
Throughout this document, the prefix date is used to refer to this namespace. Any other prefix can be used within a particular stylesheet (though a prefix must be specified to enable the extension functions to be recognised as extensions).

To use these extensions, you need to declare this namespace as an extension namespace in your stylesheet. If your processor supports this module, then that's all you need to do, but if it doesn't, then you need to use a specific third-party implementation or the module stylesheet. Typically, your stylesheet will look like:

<xsl:stylesheet version="1.0"
                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.xsl" />

...
              
</xsl:stylesheet>


--  作者:redskywy
--  发布时间:9/9/2007 8:34:00 PM

--  
但是我用这个试过总是提示
此处不能使用关键字 import。 编译包含或引入的样式表 'file:///E:/all-exslt/date/functions/format-date/date.format-date.xsl' 时发生错误。

我测试文件夹如下:
├─ test.xml
├─test.xsl
├─date.xsl
├─elements
│  └─date-format
└─functions
    ├─add
    ├─add-duration
    ├─date
    ├─date-time
    ├─day-abbreviation
    ├─day-in-month
    ├─day-in-week
    ├─day-in-year
    ├─day-name
    ├─day-of-week-in-mo
    ├─difference
    ├─duration
    ├─format-date
    ├─hour-in-day
    ├─leap-year
    ├─minute-in-hour
    ├─month-abbreviatio
    ├─month-in-year
    ├─month-name
    ├─parse-date
    ├─second-in-minute
    ├─seconds
    ├─sum
    ├─time
    ├─week-in-month
    ├─week-in-year
    └─year


--  作者:Qr
--  发布时间:9/10/2007 8:38:00 AM

--  
<xsl:import href="date.xsl" />一定要紧跟<xsl:stylesheet>
这时你就要注意其它XSL与date.xsl的相对路径了,偶没有注意了解这个扩展。
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
7,226.563ms