Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: ignore empty tags [Thread Next] Re: ignore empty tagsTo: NULL Date: 6/6/2005 9:31:00 AM "N. Demos" <stormbringer_seven@h...> wrote in message news:8GRne.881431$w62.143038@b...... > Raj wrote: >> Hi >> >> I have had a quick look at the posts and have not found an answer yet. >> >> I have the following XML in two different files: >> >> file1: >> >> <row> >> <Desc>Missing from us</Desc> >> <Building>82</Building> >> <T>8.40</T> >> <Billref>009530393</Billref> >> <Postcode>SE10 8QW</Postcode> >> </row> >> >> file2: >> >> <row> >> <Desc>Missing from us</Desc> >> <T>108.10</T> >> <Billref>904158</Billref> >> </row> >> >> >> And the following in an XSL stylesheet: >> >> <xsl:template match="/one/miss/table/row"> >> <tr> >> <td align="left" class='bodyrow'><xsl:value-of select="Desc"/></td> >> <td align="left" class='bodyrow'><xsl:value-of select="Billref"/></td> >> <td align="right" class='bodyrow'><xsl:value-of select="T"/></td> >> <xsl:if test="Building[.='']"> >> <td align="left" class='bodyrow'><xsl:value-of >> select="Building"/></td> >> </xsl:if> >> <xsl:if test="Postcode[.='']"> >> <td align="left" class='bodyrow'><xsl:value-of >> select="Postcode"/></td> >> </xsl:if> >> </tr> >> </xsl:template> >> >> So that file1 will display 5 columns in a table and file2 only 3. This >> worked correctly with file1 before I added the if statements to >> accommodate file2 with the same stylesheet. Noe file2 displays >> correctly, but file1 shows no Building or Postcode data. >> >> Any help would be appreciated. >> >> Regards, > > > Instead of > <xsl:if test="Postcode[.='']"> > ... > > Try > > <xsl:if test="Postcode"> Hey, that worked! Thanks for your help. Kind regards, Raj | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
