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

Re: How can I not include empty elements?

From: Լեւոն Մկրտչյան <levon@altjira.co.uk>
Date: Sun, 18 May 2008 18:15:34 -0500
To: www-xsl-fo@w3.org
Message-ID: <fec7cacbc6aa9ab56d137f66deabe0cf@localhost>

In reply to David A's comments, he has made a slight mistake in his reply when he says the text() function returns nodes that have text. This function will actually return to text node. You would probably want to do something like this:

<xsl:for-each select="//artits/artist">
	<xsl:if test="text()">
		<td><xsl:value-of select="node()" /></td>
	</xsl:if>
</xsl:for-each>
 
           .-.                    
                .-'``(|||)                                     Լեւոն Մկրտչյան
      ,`     `-`.                http://altjira.co.uk/
     /    '``-.   ` 
   .-.  ,       `___: 
  (:::) :        ___ 
   `-`  `       ,   : 
        / ,..-`   , 
      `./ /    .-.` 
         `-..-(   ) 
               `-` 
Received on Monday, 19 May 2008 02:25:50 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:58:32 UTC