Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How do i convert to uppercase in XSLT using sharepoint designer

Posted on 2010-11-24
4
Medium Priority
?
1,932 Views
Last Modified: 2013-11-08
I have a transformation in XSLT by which I am trying to convert the default display of the file type of an uploaded document from lower case to upper case.eg; pdf to PDF. How am I able to do this.

<xsl:value-of select="upper-case(@File_x0020_Type)"  disable-output-escaping="yes"/>

This gave me an error. Can you please help me in which function to use and how to use it. Thanks in advance.
0
Comment
Question by:FPI_DEVTEAM
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 2000 total points
ID: 34210647
<xsl:value-of select="translate(@File_x0020_Type, 'azertyuiopqsdfghjklmwxcvbn', 'AZERTYUIOPQSDFGHJKLMWXCVBN')"/>

it is a bit awkward, but upper-case() is an XSLT2 function.
In sharepoint XSLT (which is XSLT1) you need to use translate

If you have a number of uppercases to make, put the lookup strings in global variables
<xsl:variable name="lc" select="'azertyuiopqsdfghjklmwxcvbn'"/>
<xsl:variable name="uc" select="'AZERTYUIOPQSDFGHJKLMWXCVBN'"/>

and use
<xsl:value-of select="translate(@File_x0020_Type, $lc, $uc)"/>
for upper-case
and
<xsl:value-of select="translate(@File_x0020_Type, $uc, $lc)"/>
for lower-case
0
 

Author Comment

by:FPI_DEVTEAM
ID: 34210722
sorry gertone. i want you to please let me know how do I use the upper-case() statement. what is the syntax. what is the namespace i should add?
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 34210726
Maybe I was not clear enough.
You simply CAN'T use upper-case().
It is a non existent function in sharepoint XSLT as far as I know, it is XSLT2, so not supported in Sharepoint

If you want to upper-case, you need to use the workaround I have shown
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 34210741
maybe you want some references, stating the same
http://mosslabs.blogspot.com/2009/02/convert-value-to-uppercase-or-lower.html
http://blog.tallan.com/2008/10/22/convert-xslt-variables-to-upper-or-lower-case/
http://stackoverflow.com/questions/586231/how-can-i-convert-a-string-to-upper-or-lower-case-with-xslt

since they are at least about two years old,
I found you a reference of a guy building an uppercase template for his library in SS2010
http://spxslt.codeplex.com/wikipage?title=ToUpper&referringTitle=Documentation
doing the same
so the issue still exist
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will learn how to count occurrences of each item in an array.

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question