Solved

xpath: how to capitalize the first word

Posted on 2002-03-22
3
475 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 our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Nessus Scan 1 72
Issue with XSLT mapping 10 43
Help needed with Powershell  XML to MySQL 5 60
XML extra information 8 30
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.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

830 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