[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: how to use normalize-space

Subject: Re: how to use normalize-space
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 9 Dec 1999 14:19:21 GMT
normalise space
<xsl:template match="p[list]">
	<List>
  <xsl:if
    test="normalize-space(list[listitem='Related topics'])">
    <ListTitle><xsl:value-of select="list/listitem"/></ListTitle>
  </xsl:if>	
  <xsl:for-each select="list/listitem"><!-- if it's value is not 'Related topics' -->
 <ListItem><xsl:apply-templates/></ListItem>
</xsl:for-each>
	</List>
</xsl:template>


   "normalize-space(list[listitem='Related topics'])"

would select the list nodes with listitemm child equal to
(exactly) 'Related topics'
Then take the string value of that list, and normalise it's white space.
As it's used in a boolean context, thi swill be true if its non empty.

Probably what you want to do is select the list elements with listitem
elements with normalised value   'Related topics'

which is
   "list[normalize-space(listitem)='Related topics']"

The comment  if it's value is not 'Related topics' above is false.
That is not an else-clause to the if, it is just the following
expression so it will always be evaluated.

To get the effect of an `else' you want to use xsl:choose not xsl:if.
then you can use xsl:otherwise.

David


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.