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

Recursive Search, finding duplicates + merge them

Subject: Recursive Search, finding duplicates + merge them
From: wulfhtmlteam@xxxxxx
Date: Mon, 17 Nov 2003 21:11:28 +0100
recursive search
Hi,

I have a problem designing my xsl stylesheet.
My xml file looks like this:

<root>
  <science id="cavepainting"/>

  <science id="mysticism">
    <depended on="cavepainting" minimumlevel="1"/>
  </science>

  <science id="earthelemental">
    <depended on="mysticism" minimumlevel="2"/>
    <depended on="cavepainting" minimumlevel="2"/>
  </science>

  <defense id="wallofearth">
    <depended on="earthelemental" minimumlevel="3"/>
  </defense>
</root>

As you can see to have a wallofearth, you will first need an earthelemental of level 3 which depends on mysticism level2 and so on....

Now the problem is to get ALL the dependencies for the earth wall out of the xsl.
Unfortunately you will get something like this using my current recursive traversal xsl:

wallofearth depends on:
  earthelemental >= 3
    mysticism >= 2
      cavepainting >= 1
    cavepainting >= 2

As you can see there are 2 cavepainting dependency, but I only need the greater one.. 
This would not be a problem which could not be solved by hand,
if I only had those four objects of class science and external.
Instead I got hundreds of them.


So what is it, what I want? It would be really great, if I could _write_ in my xml :

  <defense id="wallofearth">
    <depended on="earthelemental" minimumlevel="3"/>
  </defense>

and my findAllDependencies.xsl would translate to:

  <defense id="wallofearth">
    <depended on="mysticism" minimumlevel="2"/>
    <depended on="cavepainting" minimumlevel="2"/>
    <depended on="earthelemental" minimumlevel="3"/>
  </defense>

of course without duplicates and using the maximum value for the minimumlevel attribute.

Thanks for helping..
______________________________________________________________________________
WEB.DE FreeMail wird 5 Jahre jung! Feiern Sie mit uns und
nutzen Sie die neuen Funktionen http://f.web.de/features/?mc=021130


 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.