xsl-list
[Top] [All Lists]

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

2003-11-13 05:11:46
Followed a couple of your suggestions:


Added the <xsl:choose> stupid of me to forget
 <xsl:template match="Row/*">
 
     <fo:table-cell border="solid black 1 px" border-collapse="collapse" 
padding-right="5px" padding-top="3px">
     <xsl:choose>
      <xsl:when test="Row/Column_01[not(.='Total')]">
         <fo:block>
         <xsl:value-of select="node()[not(.='null')]"/>
         </fo:block> 
      </xsl:when>
      <!-- if column-01 is Total diff format -->
     <xsl:otherwise>
         <fo:block font-size="12px" font-weight="bold">
         <xsl:value-of select="node()[not(.='null')]"/>
         </fo:block> 
     </xsl:otherwise>
     </xsl:choose>
     </fo:table-cell>
  

 </xsl:template>

Now all the data is bold, but at least i don't get a parse error. So my when - 
otherwise isn't working properly.

[quote]
using square brackets where none are needed
[/quote]
Hmm, indeed <xsl:when test="Row/Column_01!='Total'"> is better, right?
btw it doesn't hurt to use bracket's because me and my typos you know.

Your other suggestions

By which i use two different templates:
"   put a . before =" and "use single quotes here" (my typos)
Gives me no parse error but also doesn't give me all the data and Total isn't 
bold

Grtz,




----- Original Message ----- 
From: "Andreas L. Delmelle" <a_l(_dot_)delmelle(_at_)pandora(_dot_)be>
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Sent: Thursday, November 13, 2003 12:22 PM
Subject: RE: [xsl] Node test--> text -->different format 


-----Original Message-----
From: Barry van Weldam

Now i just want to test if Row/Column_01 has a value of "Total"
and if so i want to format the text bold.

Tried the following:

 <!--Here i use a tmpl for each cell -->
 <xsl:template match="Row/*">
 <xsl:when test='Row/Column_01[.!="Total"]'>

Ouch! You are testing on a Row child of the Row element here, forgetting the
enclosing xsl:choose and using square brackets where none are needed

Try your code below again but ...


 <!--Here i use a tmpl for each cell -->
 <xsl:template match="Row/Column_01[not(='Total']">
                                         ^^^
                                       put a . before =

     <fo:table-cell border="solid black 1 px"
border-collapse="collapse" padding-right="5px" padding-top="3px">
         <fo:block>
         <xsl:value-of select="node()[not(.='null')]"/>
         </fo:block>
     </fo:table-cell>
 </xsl:template>
<!-- if column-01 is Total diff format -->
 <xsl:template match="Row/Column_01[.="Total"]">
                                       ^^^   ^^^
                                     use single quotes here


     <fo:table-cell border="solid black 1 px"
border-collapse="collapse" padding-right="5px" padding-top="3px">
         <fo:block font-weight="bold">
         <xsl:value-of select="node()[not(.='null')]"/>
         </fo:block>
     </fo:table-cell>
 </xsl:template>


Cheerz,

Andreas


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



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