[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
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|