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

Re: Sorting and Merge

Subject: Re: Sorting and Merge
From: Dongling Ding <dling61@xxxxxxxxx>
Date: Mon, 17 Nov 2003 11:44:53 -0800 (PST)
name sort
Thank Dimitre,

Let me give a clearer description of the problem.

We have a member structure and allow users to define
filters based on it. We can generate the result after
applying those filters. But the problem is that result
is messed up since the filter was applied
sequentially.


Here is an example of the original member structure.
The actual structure can be very deep in terms of
hierarchy.


<MemberList>
    <Member name="P1">
	<Member name="P11">
			<Member name="P111"/>
	</Member>
	<Member name="P12">
			<Member name="P121"/>
	</Member>
    </Member>
    <Member name="P2">
		<Member name="P21"/>
                <Member name="P22"/>
    </Member>
</MemberList>

Here there are three filers created by user:

1. select the member name "P121" and its ancestors.
They are P121, P12, and P1.
2. select the member name "P2" and its children. They
are P2, P21, and P22.
2. select the member name "P1" and its children. So,
P1, P11, and P21,

After those filters are applied sequentially, we got
the following result, but it contains duplicated
members and order of members is not the same as
original one.

<MemberList>
<Member name="P1">
	<Member name="P12">
		<Member name="P121"/>
	</Member>
</Member>
<Member name="P2">
		<Member name="P21"/>
                <Member name="P22"/>
</Member>
<Member name="P1">
	<Member name="P11"/>
	<Member name="P12"/>
</Member>
</MemberList>

Therefore, the transformation requirement is to merge
and reorder the above result based on the original
member structure. Dimitre suggested earlier to add one
attribute "_pos" to indicate the member position in
the above result. It looks like this:

<Member _pos="1" name="P1"/>

It helps when we have one or two levels. But we need
to go down each level and figure out the
position(recursive)and get rid of duplicate members.
This transformation seems doing merge and sorting.
Please help me on this!


Thanks


Dongling






__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

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