Set current date as transformation scenario parameter
Are you missing a feature? Request its implementation here.
-
- Posts: 1
- Joined: Sat Jan 10, 2009 7:14 pm
Set current date as transformation scenario parameter
Post by mrlucmorin »
Hi,
I don't know if what I'm looking for is already there, I tried to find it but couldn't.
I have some transform style sheets that expect a date parameter, and I'd like to have a variable, just like the ones available right now, like ${cfd} for the current file directory, but for the current date.
This way the current date would always be passed to the template and I wouldn't have to manually enter it each time.
Thank you.
I don't know if what I'm looking for is already there, I tried to find it but couldn't.
I have some transform style sheets that expect a date parameter, and I'd like to have a variable, just like the ones available right now, like ${cfd} for the current file directory, but for the current date.
This way the current date would always be passed to the template and I wouldn't have to manually enter it each time.
Thank you.
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Set current date as transformation scenario parameter
Post by sorin_ristache »
Hello,
You can just use the XSLT 2.0 functions current-date() and current-dateTime(). If you have to use XSLT 1.0 you can call the Java class java.util.Date in a Java extension of your XSLT 1.0 stylesheet. Both the XSLT 2.0 functions and the class java.util.Date called as Java extension return the current date / date and time at the moment of XSLT processing.
Regards,
Sorin
You can just use the XSLT 2.0 functions current-date() and current-dateTime(). If you have to use XSLT 1.0 you can call the Java class java.util.Date in a Java extension of your XSLT 1.0 stylesheet. Both the XSLT 2.0 functions and the class java.util.Date called as Java extension return the current date / date and time at the moment of XSLT processing.
Regards,
Sorin
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service