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

Re: xsl grabbing specific data

Subject: Re: xsl grabbing specific data
From: "cking" <cking@xxxxxxxxxx>
Date: Fri, 10 Sep 2004 17:36:36 +0200
ace.trustee
Hi Dan,

Muenchian grouping is a method you can use to remove duplicates,
full explanation here:
http://www.jenitennison.com/xslt/grouping/muenchian.html

Your input looks like

    <file-acl-list>
        <file-acl name="C:\WINDOWS\system32\compmgmt.msc">
            <ace trustee="XPTEST\Users" ... />
            <ace trustee="XPTEST\Power Users" ... />
            <ace trustee="XPTEST\Administrators" ... />
            <ace trustee="SYSTEM" ... />
        </file-acl>
        <file-acl name="C:\boot.ini">
            <ace trustee="XPTEST\Administrators" ... />
        </file-acl>
        <file-acl name="C:\autoexec.bat">
            <ace ... />
        </file-acl>
        ...
    </file-acl-list>

With the Muenchian method you can use a key like

    <xsl:key name="files" match="//file-acl-list/file-acl" use="@name"/>

to "group" the file-acl elements by their @name, by (for-each or template)

    select="//file-acl-list/file-acl[count(. | key('files', @name)[1]) = 1]"

That would give you a list without duplicates. Of course, case sensitive...
if you want a case insensitive comparison, you can replace "@name" with
"translate(@name, $upper, $lower)", both in the key's use attr, and in the 
for-each's select attr. 

HTH,
Anton Triest

----- Original Message ----- 
From: "tom jones" <h8_bsod@xxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, September 09, 2004 10:49 PM
Subject: Re:  xsl grabbing specific data


> Sorry for not being clear. I mean duplicates in the
> original input. What is Muenchian Grouping?
> 
> Thanks,
> 
> Dan

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