Solved

xpath: how to capitalize the first word

Posted on 2002-03-22
3
481 Views
Last Modified: 2008-03-10
Hi,

I have an xsl file for transforming xml data to html. Does anyone know how to make the first alpahabet in a String to Upper case? i.e

I want the button to show Albert instead of albert

thanks.

xml data
<stuff>
  <some>
     <name>albert</name>
  </some>
</stuff>

xsl code sniplet
<xsl:variable name="somename" select="/stuff/some/name" />
...
....
...

<input type="submit" name="Submit" value="{$somename}"/>

0
Comment
Question by:ahuen
[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
  • 2
3 Comments
 
LVL 14

Expert Comment

by:avner
ID: 6891922
Use CSS for that :

<STYLE>
    BUTTON:first-letter {text-transform: uppercase ;font-weight:400; }
</STYLE>

<BUTTON>ahhhhhh !</BUTTON>
0
 

Author Comment

by:ahuen
ID: 6893789
avner,

Please provide more details.

Thanks.
0
 
LVL 14

Accepted Solution

by:
avner earned 20 total points
ID: 6893800
Take this bit of code :

<STYLE>
   P:first-letter {text-transform: uppercase ;font-weight:400; }
</STYLE>

<P>ahhhhhh !</P>

Save it under a file named  : something.html

View this code in the browser you'll see that the first A is capitlzed.

The thing is Pseudo-classe "first letter" , it means give a specific STYLE to the first letter , in this letter I use :
text-transform: uppercase  , whihc means UPCASE this letter.

Hope it helps a little more.

0

Featured Post

Technology Partners: 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

Suggested Solutions

Title # Comments Views Activity
C# SQL BULK INSERT CLASS 5 51
Create html table using xsl 8 49
xslt 1.0 - How to split value 8 49
Health check of winows and webservces 5 52
Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

752 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