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

Clean data using XSLT

Subject: Clean data using XSLT
From: Michal_Mart@xxxxxxxxxxx
Date: Mon, 7 Aug 2000 14:34:12 -0400
clean data

Hi,
I have some data in the following format:
<RootNode>
     <Property Id="103">
     2109 B'way
     </Property>
     <Property Id="103">
     2109 Bdwy
     </Property>
     <Property Id="103">
     2109 Broadway
     </Property>
     <Property Id="104">
     5 Bleecker Street
     </Property>
     <Property Id="104">
     5 Bleeker Street
     </Property>
     <Property Id="104">
     5 Bleecker Street
     </Property>
     <Property Id="103">
     2109 Broadway
     </Property>
</RootNode>

I use this XSLT on it:
<xsl:for-each select='//Property[not(.=preceding::Property)]'>
     <xsl:sort select="@Id" />

     <xsl:variable name="PropertyAddress" select="text()" />

     <BR />
     <xsl:value-of select="@Id" />) <xsl:value-of select="." />
     (appears <xsl:value-of select="count(//Property[.=$PropertyAddress])" />
times)

</xsl:for-each>

This gives me the following input:
103) 2109 B'way (appears 1 times)
103) 2109 Bdwy (appears 1 times)
103) 2109 Broadway (appears 2 times)
104) 5 Bleecker Street (appears 2 times)
104) 5 Bleeker Street (appears 1 times)

I would like to have the data also sorted by the number of times this version of
 the address appears in the data, so my output would be:
103) 2109 Broadway (appears 2 times)
103) 2109 B'way (appears 1 times)
103) 2109 Bdwy (appears 1 times)
104) 5 Bleecker Street (appears 2 times)
104) 5 Bleeker Street (appears 1 times)

Can someone tell me how to do this?
I am using the July version of the MSXML parser.

Thanks for your help,
Michal




 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-2011 All Rights Reserved.