Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Nesting Output

Status
Not open for further replies.

Nosferatu

Programmer
Jun 9, 2000
412
RO
Everybody...

Do you know someone that knows someone :)... that knows how to dynamically add indentation using XSLT, to obtain a nesting similar to the one in the XML view of explorer (without the + signs and stuff).

Is there a function for retrieving the current depth of a node?

Thanks.. [red]Nosferatu[/red]
We are what we eat...
There's no such thing as free meal...
once stated: methane@personal.ro
 
Well, lately it seems I am giving answers to my own questions... so, here I go again, in case anybody wonders how to do this...

For the counting the ancestors question:

count(ancestor::*).

For dynamic indentation:
pass a string parameter to the templates that gets incremented (stuff is appended to it) as we go deeper into the XML tree and then displayed when necessary, obtaining an indentation-like effect.

I haven't tried with a <span style=&quot;text-indent:$indent&quot;> parameter, I am not sure if it works (...apparently it doesn't) [red]Nosferatu[/red]
We are what we eat...
There's no such thing as free meal...
once stated: methane@personal.ro
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top