Solved

xpath: how to capitalize the first word

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
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.
This video discusses moving either the default database or any database to a new volume.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

758 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now