|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: xsl grabbing specific data
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
|
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








