473,387 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

recursion problem

Ben
Hi!
im trying to get my head around xslt and xml but my brain is simple
and nt let me do much >.<
im trying to create a stylesheet for this xml

<UsersPermissions>

<userPermissions>
<user>dala2</user>
<rights>Read</rights>
<location>C:\Test</location>
</userPermissions>

<userPermissions>
<user>senk2</user>
<rights>Read</rights>
<location>C:\Test</location>
</userPermissions>

<userPermissions>
<user>senk1</user>
<rights>Read</rights>
<parent>C:\Test</parent>
<location>C:\Test\New Folder</location>
</userPermissions>

</UsersPermissions>

what im tyring to do is display it in a heirarchy format based on
location
such as:
-C:\Test
------------New Folder

so items are displayed in their folder structure with New Folder being
a subfolder
i came on to the idea of attempting to group them under the parent tag
but then i just confused myself >.<

this is the xsl i have so far
-------------
<xsl:for-each select="UsersPermissions">
<xsl:for-each select="userPermissions">
<li><xsl:value-of select="location"/></li>
<xsl:choose>
<xsl:variable name="KK"><xsl:value-ofselect="parent"/></
xsl:variable>
<xsl:when test="location = $kk">
<ul><li><xsl:value-ofselect="location"/>
</li></ul>
</xsl:when>
</xsl:choose>
</xsl:for-each>
</xsl:for-each>
--------------

but it doesnt work, becuase im an idiot >.<

Does anyone have any idea's on how i can accomplish this?

Thanks!

Ben

Aug 29 '07 #1
1 1521
You might want to start by looking at the sorting and grouping sections
of the XSLT FAQ website.

http://www.dpawson.co.uk/xsl/sect2/sect21.html
--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Aug 29 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

43
by: Lorenzo Villari | last post by:
I've tried to transform this into a not recursive version but without luck... #include <stdio.h> void countdown(int p) { int x;
10
by: paulw | last post by:
Hi Please give problems that "HAS TO" to use recursion (recursive calls to itself.) Preferrably real world examples, not knights tour. I'm thinking about eliminating the use of stack... ...
75
by: Sathyaish | last post by:
Can every problem that has an iterative solution also be expressed in terms of a recursive solution? I tried one example, and am in the process of trying out more examples, increasing their...
18
by: MTD | last post by:
Hello all, I've been messing about for fun creating a trial division factorizing function and I'm naturally interested in optimising it as much as possible. I've been told that iteration in...
6
by: Andre Kempe | last post by:
hej folks. i have a heap with fixed size and want to determine the depth of a element with given index at compile-time. therefore i wrote some templates. however, when i use template...
12
by: NOO Recursion | last post by:
Hi everyone! I am trying to write a program that will search a 12x12 for a thing called a "blob". A blob in the grid is made up of asterisks. A blob contains at least one asterisk. If an...
13
by: Mumia W. | last post by:
Hello all. I have a C++ program that can count the YOYOs that are in a grid of Y's and O's. For example, this Y O Y O O Y O Y O Y O O Y O Y Y O Y O Y O O Y O O Y Y O Y O
2
by: Victor Lin | last post by:
Hi, I encounter a problem with pickle. I download a html from: ...
30
by: Jeff Bigham | last post by:
So, it appears that Javascript has a recursion limit of about 1000 levels on FF, maybe less/more on other browsers. Should such deep recursion then generally be avoided in Javascript?...
35
by: Muzammil | last post by:
int harmonic(int n) { if (n=1) { return 1; } else { return harmonic(n-1)+1/n; } } can any help me ??
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.