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

1
  • Can you please add your stylesheet (or a small sample exhibiting the problem)? There should be no need for including the namespace. Commented May 20, 2010 at 13:24

2 Answers 2

3

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.