Re: [xsl] Re: Inserting File Attributes Into XSLT Output

Subject: Re: [xsl] Re: Inserting File Attributes Into XSLT Output
From: Emmanuel Bégué <medusis@xxxxxxxxx>
Date: Thu, 13 Dec 2012 11:39:31 +0100
2012/12/12 Liam R E Quin <liam@xxxxxx>:
> On Wed, 2012-12-12 at 16:19 -0500, Nathan Tallman wrote:
>> Was trying to find a way to inform the user of the linked
>> PDF file size, so they can download instead of opening in the browser,
>> if they so choose.
>
> There's an ls2xml script floating around, and David Lee's xmlsh may be
> able to do it too, in both cases by creating an auxilliary XML file
> containing the file sizes. Or write a short program to do it, depending
> on your operating environment (Linux, VMS, Solaris, Microsoft Windows
> 3.11, etc.)

Here's a small Java application that generates an XML listing of a
given directory:
http://code.google.com/p/xml-dir-listing/

It works flawlessly in my experience.

If each filename is unique (if no two files in different directories
have the same name) you can retrieve the size of each file with a key
on the 'file' element / 'name' attribute of the generated XML dir.

Regards,
EB

Current Thread