Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1018
  • Last Modified:

xsl - if not empty, write out a <BR />

have the following XSL

              <xsl:value-of select="Address1"/>
              <br />
              <xsl:value-of select="Town"/>
               <br />

However, if address1 or town is empty, i need to not have a <BR /> after it.

so i need to test to see if address1/town if not empty, and put the <BR> after it

something like
if <xsl:value-of select="Address1"/> not empty then
  <xsl:value-of select="Address1"/> <br />
end if

Thanks
0
paulCardiff
Asked:
paulCardiff
1 Solution
 
hieloCommented:
try:
<xsl:if test="Address!=''">
  <xsl:value-of select="Address1"/> <br />
</xsl:if>

Open in new window

0
 
paulCardiffAuthor Commented:
bingo!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now