Hi, Kai,

Here are two layouts of a file structure. (To appear correctly, they need 
to be viewed with a monospace font.) Since I don't like to send images to 
mailing lists, I have used text symbols as shown below:

|-A node that is not the last node at its level
 -A node that is the last node at its level
| Continuation of an ancestor level

| |-File11
|  -File12
| |-File21
| |-File22
| |-Dir21
| | |-File211
| | -File212
|  -Dir22
|   -File221


Which one are you after? Or have I not grasped the problem?

In the first case, you need either a for-each or a recursive template to 
generate all the "continuation" images and space them properly. In the 
second, you don't, because you can just multiply the level by the indent 
amount per level. (If you are writing to HTML rather than PDF, you could 
use a for-each to generate the right number of nbsp characters or empty 
table cells or whatever.)

>From a user-interface design point of view, by the way, the second view is 
much better. The first is very cluttered. All those lines draw the eye 
away from the information that matters without adding any value. If you 
must do the first, you should make the lines NOT stand out (light grey and 
thin lines would do).

By the way, the Windows XP Explorer just has boxes with + and - signs. It 
has no lines at all, relying purely on indentation to show the relation 
between levels. In my view, that's one of the things Microsoft did right.

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)

"Kai Hackemesser" <[EMAIL PROTECTED]> 
02/21/2005 11:45 AM
Please respond to


Re: XSLT Question

Hi J,

Partly you are right, with your test I can tell what image I need for the
current level of the tree, but I can't see how to retrieve the required
images from lower levels. the test you described needs to be done for 
element up to level 0. It's not just the Indent which I want to show, but
also some lines and branches, depending from the structure. Like the 
tree in an windows explorer window. 


> Hi, Kai,
> I don't think you need to call a template for that. You can test for the 

> characteristics of the  node from within the matching template and get 
> image you need.
> Several xsl:when statements within an xsl:choose block should let you 
> figure out which images to use when. For example, <xsl:when 
> test="generate-id(.)=generate-id(../*[last()])"> will tell you whether 
> current node is the last child node of its parent. Also, to indent 
> properly, you can read the Level attribute and put the appropriate 
> of indentation objects (blank table cells, spaces, whatever you use) 
> before the image.
> J

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to