|
Subject: Re: [xsl] Date and Time of a File From: Mukul Gandhi <gandhi.mukul@xxxxxxxxx> Date: Fri, 18 Mar 2011 10:16:18 +0530 |
Here's an example (untested),
import java.util.Date;
public class DateUtil {
public static String getDateTimeStamp(String filePath) {
String dataTimeString = "File not found";
File file = new File(filePath);
if (file.exists()) {
dataTimeString = (new Date(file.lastModified())).toString();
}
return dataTimeString;
}
}
Then invoke above API using a processor specific way. An example using
Xalan (which will work in XSLT 1.0 environment) is here,
http://xml.apache.org/xalan-j/extensions.html#ex-java-namespace
Though I don't encourage to work in XSLT 1.0 environment. Please use
XSLT 2.0 if you can.
On Thu, Mar 17, 2011 at 7:24 PM, Terry Badger <terry_badger@xxxxxxxxx> wrote:
> Is there an xsl example somewhere of using a java call to return the date and time stamp of an xml file?
--
Regards,
Mukul Gandhi
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] Date and Time of a File, Andrew Welch | Thread | Re: [xsl] Date and Time of a File, Florent Georges |
| [xsl] Processing mutiple files in m, Mark | Date | Re: [xsl] Processing mutiple files , Liam R E Quin |
| Month |