W3C home > Mailing lists > Public > www-xsl-fo@w3.org > May 2015

Re: How can I not include empty elements?

From: David Arakelian <david@theatons.com>
Date: Wed, 14 May 2008 17:57:55 +0100
To: www-xsl-fo@w3.org
Message-Id: <1210784264.9635.5.camel@dhopkins-laptop>
You can also do something like this. Forgive me for not using your code,
but I think it would be easier due to its length:

** XML **

	<artist>Fela Anikulapo Kuti</artist>
	<artist>Gaspar Lawal</artist>

<xsl:for-each select="//artits/artist[text()]">
	<td><xsl:value-of select="." />

The text() function just selects any node that has text content. I'm not
sure if it will work for whitespace. You can find reference on the XPath
functions here: http://saxon.sourceforge.net/saxon6.5.3/expressions.html

Although I think its rather slim and incomplete.

      ,'/:.          David Arakelian 
    ,'-/::::.        http://www.theatons.com/
  ,'--/::(@)::.      Web Security Consultant
,'---/::::::::::.    Wales
  T H E A T O N S  
Received on Saturday, 30 May 2015 04:00:50 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:10:19 UTC