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

Re: Tree from directory listing

Subject: Re: Tree from directory listing
From: Mukul Gandhi <mukul_gandhi@xxxxxxxxx>
Date: Thu, 16 Dec 2004 00:55:39 -0800 (PST)
mukul gandhi
Hi Geert,
  Thanks a lot for pointing the bug.. I was infact
testing my stylesheet again, and was getting
StackOverFlow error. And your mail pointed the bug..
Thanks for saving my time!

I suggest, please post your XSL. It'll help the
original poster.

Regards,
Mukul

--- Geert Josten <Geert.Josten@xxxxxxxxxxx> wrote:

> Hi Mukul, (and others,)
> 
> Ah, it does process deeper directories, apart from a
> minor bug (you are passing @path in the named 
> templates instead of $path).
> 
> Though, the result doesn't look like what I would
> have expected. It only merged folders and 
> subfolders properly when the files are sorted in
> advance, so it seems..
> 
> Generalizing on the original question, I feeded your
> stylesheet the following XML and had to fix the 
> case where the $path contains less than 2 slashes to
> prevent (another) endless loop:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <root>
>    <file name ="f5.xyz"
> path="/test2/folderInFolder3/folderInFolder4/"/>
>    <file name ="f1a.xyz" path="/"/>
>    <file name ="f1.xyz" path="/test/"/>
>    <file name ="f4b.xyz"
> path="/test/folderInFolder2/"/>
>    <file name ="f3.xyz"
> path="/test/folderInFolder/"/>
>    <file name ="f2.xyz"
> path="/test/folderInFolder/"/>
>    <file name ="f4.xyz"
> path="/test/folderInFolder2/"/>
>    <file name ="f5b.xyz"
> path="/test2/folderInFolder3/"/>
> </root>
> 
> (I deliberately mixed the order)
> 
> I was also wondering what would happen if the input
> doesn't supply a file for each subfolder that 
> should be output. For example just:
> 
>    <file name ="f1a.xyz" path="/"/>
>    <file name ="f4b.xyz"
> path="/test/folderInFolder2/"/>
> 
> The result was getting a bit awkward by this time,
> so I tried to work out the following approach:
> build a folder structure for each file separately
> and merge it in a second step.
> 
> Less efficient maybe, but it seems to do its job
> quite well..
> 
> If anyone is interested, I'll share the
> stylesheet...
> 
> Cheers,
> Geert
> 
> > The XSL works on folder structure any deep..
> > 
> > Regards,
> > Mukul
> > 
> > --- Geert Josten <Geert.Josten@xxxxxxxxxxx> wrote:
> > 
> > 
> >>Hi,
> >>
> >>Ah! It took a second look to notice that the
> xsl:key
> >>is being applied to the contents of the RTF 
> >>variable as well... :)
> >>
> >>Does it work on a three level deep folder
> structure
> >>as well?
> >>
> >>Cheers
> >>
> >>Mukul Gandhi wrote:
> >>
> >>
> >>>Below is a XSLT 1.0 solution. I have used the
> >>
> >>node-set
> >>
> >>>extension function..
> > 
> > 
> > 
> > 
> > 		
> > __________________________________ 
> > Do you Yahoo!? 
> > Check out the new Yahoo! Front Page. 
> > www.yahoo.com 
> > 
> > 
> > 
> 
> -- 
> Geert.Josten@xxxxxxxxxxx
> IT-consultant at Daidalos BV, Zoetermeer (NL)
> 
> http://www.daidalos.nl/
> tel:+31-(0)79-3316961
> fax:+31-(0)79-3316464
> 
> GPG: 1024D/12DEBB50
> 
> 



	
		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - You care about security. So do we. 
http://promotions.yahoo.com/new_mail

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.