Solved

xpath: how to capitalize the first word

Posted on 2002-03-22
3
470 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
  • 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Change to event 1 112
How to obtain string using substring and indexOf function 11 59
Problem to event 3 95
Insert Powershell variable into XML 4 45
The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 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