- From: Adrian Edwards <Adrian.Edwards@tpiap.com.au>
- Date: Mon, 24 May 1999 15:45:42 +1000
- To: xsl-editors@w3.org
Would it be possible to add an ends-with() function to section 6.2.5 [Strings] of the XSLT spec? Since normalize() removes leading and trailing whitespace from strings, when text nodes from mixed content are normalised it sometimes helps to consider punctuation characters at the start and end of the content. starts-with() is a great help here. For example: /* Called when current node is text node. */ <xsl:template name="textInMixedContent"> <xsl:if test="not(position()=1) and not(starts-with(.,',')"> <xsl:text> </xsl:text> </xsl:if> <xsl:value-of select="normalize(.)"/> <xsl:if test="not(position()=last())"> <xsl:text> </xsl:text> </xsl:if> </xsl:template> While I realise that the effectiveness of such templates is restricted by the subtletites of English puntuation (let alone that of other languages), they can help to introduce some predictability into otherwise
Received on Monday, 24 May 1999 01:44:02 UTC