tags:

views:

44

answers:

2

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 functions?

Cheers

+3  A: 

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.

Dimitre Novatchev
Yeah,that's right,I've got a version 1.0 stylesheet..I'm not sure what I'm supposed to do if I want to use XSL 2.0 though.Does it depend on the web server?
Alex
A: 

Hi,

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 funtion.

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

Now You can use $lowercase.

Ravz