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

RE: Node test--> text -->different format

Subject: RE: Node test--> text -->different format
From: "Andreas L. Delmelle" <a_l.delmelle@xxxxxxxxxx>
Date: Thu, 13 Nov 2003 20:51:39 +0100
xsl node test
> -----Original Message-----
> From: Barry van Weldam
> [quote]
> using square brackets where none are needed
> [/quote]
> Hmm, indeed <xsl:when test="Row/Column_01!='Total'"> is better, right?


<xsl:template match="Row/*">
    <xsl:when test="Row/Column_01 != 'Total'>

is the right way, *but*...

This will fail, because I believe your XML Row Element does not have child
nodes that have Row children... (just a guess) The above code would, for
every child node of a Row element, test whether its child(ren) --if any -
'Row/Column_01' equal the 'Total' string...

It would work for an XML that is structured like this:


However, I think yours looks like:


So better to replace the template by:

<xsl:template match="Row">
    <xsl:when test="Column_01 = 'Total'">
      <!-- 'Row' is the current node, so you're actually testing
           for a possible 'Row/Column_01' element here -->
      <!-- bold formatting -->
      <!-- normal formatting -->

Other suggestions? I think you can also solve it this way (a bit more

<xsl:template match="Row">
	<xsl:if test="Column_01 = 'Total'>
        <xsl:attribute name="font-weight">bold</xsl:attribute>
      <!-- content here -->

In the latter solution, you only need to describe the fo:block once, and add
the boldface if and only if the Column_01 element in the Row being processed
equals the 'Total' string.



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


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.
First Name
Last Name
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.