|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: normalize as part of a 'select-distinct' in a for-each?
] <xsl:for-each select="//c[not(normalize(text())
] =normalize(following::c/text()))]" >
You are making it hard for yourself by using for-each here, as then the
current node of the expression is the document root. You need to
get access to a c node and a following c node, and within a single
select expression the only way to do that is to arrange that one of them
is the current node.
This version uses apply-templates (and still works if you replace some
<c>X</c> by <c> X </c>, I just tried)
If this would clash with some other template for c then you could add
mode attributes to distinguish this processing.
David
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
xmlns:xt="http://www.jclark.com/xt"
extension-element-prefixes="xt">
<xsl:template match="root">
<xsl:apply-templates select="//c">
<xsl:sort select="normalize(.)"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="c">
<xsl:if test="not(following::c[normalize(.)=normalize(current())])">
<xsl:value-of select="normalize(.)"/>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
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
|

Cart








