?
Solved

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

Posted on 2008-10-21
2
Medium Priority
?
1,015 Views
Last Modified: 2013-11-18
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
Comment
Question by:paulCardiff
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 82

Accepted Solution

by:
hielo earned 2000 total points
ID: 22769112
try:
<xsl:if test="Address!=''">
  <xsl:value-of select="Address1"/> <br />
</xsl:if>

Open in new window

0
 

Author Closing Comment

by:paulCardiff
ID: 31508388
bingo!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question