Re: [xsl] building a hierarchical classification out of flat and redundant data

Subject: Re: [xsl] building a hierarchical classification out of flat and redundant data
From: "Georg Hohmann" <georg.hohmann@xxxxxxxxx>
Date: Thu, 3 Aug 2006 10:38:41 +0200
Many Thanks to David, Michael and Mukul for three different solutions
of the problem!

I needed some time to understand how each of them approaches the
problem but i think now i got it. Unfortunately none of them does the
job for my real data, but this is mainly blamed to my dull example.
Sorry for that.

Davids approach works with the sample data, but in my real data there
is no consistent sequence of numbers inside the names of the tags that
you could use to "count" the level. So although it is a very nice
approach, the "$level+1"-mechanism doesn't work for me.

Mukuls approach has the assumption that the last "document" has the
deepest level of tags. But sadly this is not true in my case. My
example is from a classification, so after the
"<document><tag1>3</tag1>..." there will be a
"<document><tag1>4</tag1>..." and so on, which makes this approach not
suitable for this kind of data.

Michaels approach seems to be the most general solution, but i
couldn't get it to work. First i added an "x" as the root of my
example file. Then i changed the match attribute to "x/document" and
erased the "s" of "deep-equals". When i run this with saxon, i get a
list of errors, beginning with "Exception in thread 'Thread-25'
java.lang.StackOverflowError at
net.sf.saxon.functions.DeepEqual.deepEquals(DeepEqual.java:186)".

But i won't surrender :-) and if i find a solution i will post it here.

Many thanks,
Georg

Current Thread