Re: showing unique element values only
Hi Keith, > I've tried manipulating the order of the ACHFee element with > <xsl:sort select="feeLevelBottom"/> and so-on. I've used every > combination of preceding::, following::, following-sibling:: that I > can come up with, but I still cannot make ONLY UNIQUE cell contents > be displayed Here's what you're missing: axes *always* operate on the structure of the original XML, it don't matter how much you sort or what axes you try. At the moment you trying to do (roughly) for each ACHfee sorted according to feeLevelBottom if you haven't already processed something with the same feeLevelBottom then process this one Instead, you need to turn it around so that you only select the first ACHfees with a particular feeLevelBottom in the first place, iterate over them, and sort *them* according to the feeLevelBottom. For example: <xsl:for-each select="//ACHFee [not(feeLevelBottom = preceding::ACHFee/feeLevelBottom)]"> <xsl:sort select="feeLevelBottom" /> ... </xsl:for-each> You may find it more efficient to use the Muenchian Method to get the list of fees with unique feeLevelBottoms. Define a key: <xsl:key name="fees" match="ACHFee" use="number(feeLevelBottom)" /> And then select the ACHFees with unique feeLevelBottom values with: <xsl:for-each select="//ACHFee [count(.|key('fees', number(feeLevelBottom))) = 1]"> <xsl:sort select="feeLevelBottom" /> ... </xsl:for-each> I hope that helps, Jeni --- Jeni Tennison http://www.jenitennison.com/ 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