[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: how to make all xsl:value-of outputs bold

Subject: Re: how to make all xsl:value-of outputs bold
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Wed, 14 Mar 2007 12:18:03 +0100
Re:  how to make all xsl:value-of outputs bold
nick humphrey wrote:
hi, i've been googling a lot and am relatively still an xsl newbie. i
was wondering how to make all the xsl:value-of outputs in my xslt to
output in bold, with only using like one line at the top of the xslt
file. is that possible? as opposed to wrapping all of them in span
tags...

With XSLT it is the other way around. You don't change the way xsl:value-of works, but you create rules that react on input nodes that, when encountered, can do whatever you want. I.e.:


<xsl:template match="Via">
  <fo:block style="font-weight:bold">
     <xsl:value-of select="." />
  </fo:block>
</xsl:template>

Now, depending on how you define your apply-templates, every "Via" node will become bold.

If, however, all you are after is creating every fo:block that is in your current stylesheet to become bold, I think you are better of setting the outermost element to have a style that includes bold. Then, your XSL-FO processor will take care of the rest.

I wonder where you get the idea that "only using like one line at the top of the xslt file" could change your output. That is not the way XSLT works. One-liners are something more common in Perl and are very powerful, but don't look for them in XSLT (but you can place your whole XSLT in one line, if that's what you're after).

Cheers,
-- Abel Braaksma
  http://www.nuntia.nl

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.