[xsl] Sort>Filter/Modify whatever...

Subject: [xsl] Sort>Filter/Modify whatever...
From: "Manos Batsis" <m.batsis@xxxxxxxx>
Date: Fri, 14 Dec 2001 14:39:04 +0200
Hallo folks,

Here is a quick description of my problem.
I have an xml file that presents user rights as:

<USERS>
 <USER name="BUILTIN\Administrators" permission="Full"/>
 <USER name="Everyone" permission="Full"/>
 <USER name="Everyone" permission="none"/>
 <USER name="NT AUTHORITY\SYSTEM" permission="Full"/>
 <USER name="EDEVMINOAS\SQLUSR" permission="Read"/>
</USERS>

Notice the 2nd and 3rd USER elements, as they refer to the same user. I
need to find such groups sets bearing multiple occurences of a name, and
select a certain one based on my priorities (for example, 'none'
superseeds 'full').

As I have thought of it, for each element of name=*, I have to check for
elements with the same name, then look within their permission attr to
pic the one I want or build one if multiple same_name elements exist
with a combination of persmission attrs that should become one complex
one. For example
 <USER name="Everyone" permission="Full"/>
 <USER name="Everyone" permission="none"/>
Should become
 <USER name="Everyone" permission="none"/>

And 

 <USER name="Everyone" permission="read"/>
 <USER name="Everyone" permission="write"/>
Should become
 <USER name="Everyone" permission="read-write"/>

I would appreciate any similar code, or advice. Another subject is I
want to avoid proccessing the same element many times if it's not needed
(something that is rather blurred in my head at this point and for a
couple of days).

Thank you for your help,

Manos


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread