开发者

Problem with using the XPATH functions

I've got a problem with using the XPATH functions. When I try to call some functions like lower-case or upper-case etc,they are not executed and I can't figure the problem out. I included the namespace xmlns:fn="http://www.w3.org/2005/xpath-functions" at the top of my XSL stylesheet and use fn namespace to call these functions but anyway nothing is working. Can anyone explain the reason and what I should do in order to be able to use the following func开发者_运维技巧tions?

Cheers


Only XSLT 2.x supports XPath 2.x. Most probably you are using an XSLT 1.0 processor.

An XSLT 2.0 stylesheet has version="2.0" attribute on its <stylesheet> element. If you feed such a stylesheet to an XSLT 1.0 processor you will get some kind of error or warning message.

Therefore, either use an XSLT 2.0 processor or don't use an XPath 2.0/ XQuery F & O function with an XSLT 1.0 processor.


If you are using XSLT 1.0, then you cannot use the functions that you have mentioned in the question.

However, you can still convert the text in lowercase using translate function.

<xsl:variable name="lowercase" select="translate($someString, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')" />

Now You can use $lowercase.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜