File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes how to underline text ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "how to underline text ?" Watch "how to underline text ?" New topic

how to underline text ?

Engin Okucu
Ranch Hand

Joined: Feb 09, 2002
Posts: 174
I have a word and i want to underline it. I know i can use <fo:inline text-decoration="underline"> but i want to underline for example only the first and second letter and inserts a space between.
Example : 'engin' --> i want to insert space after 'en' in order to underline 'en ' and to write 'gin' but without underlining it.
Balaji Loganathan
author and deputy

Joined: Jul 13, 2001
Posts: 3150
Try using the xsl function substring() and fo:inline together.
Something like..
<fo:inline underline>get first two chars using substring</fo:inline><fo:inline nounderline>& #160; get rest of the string</fo:inline>

Spritle Software Blogs
Engin Okucu
Ranch Hand

Joined: Feb 09, 2002
Posts: 174
Thanks it works fine.
I have another question.
I have a word example : 'engin'.
i use substring() to get the first and second character --> 'en'.
I insert a space after 'en' --> 'en '.
I want to underline the space also.
I tried it but it doesn't work ???I may underline only 'en' and not the space . Why ?
I agree. Here's the link:
subject: how to underline text ?
It's not a secret anymore!