[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: how to use normalize-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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|