format-date
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 5
- Joined: Thu Dec 20, 2018 1:27 pm
format-date
Hello
I have created a 1.0 stylesheet but i need the IssueDate to be in the form of YYYY-MM-DD. Now it is YYYYMMDD.
I have tried using
but it doesent work.
Anyone who knows what to do?
Thank you in advance.
I have created a 1.0 stylesheet but i need the IssueDate to be in the form of YYYY-MM-DD. Now it is YYYYMMDD.
I have tried using
Code: Select all
<xsl:template match="IssueDate">
<td>
<xsl:value-of select="format-date(.,'[Y0001]-[M01]-[D01]')"/>
</td>
</xsl:template>
Anyone who knows what to do?
Thank you in advance.
-
- Posts: 9414
- Joined: Fri Jul 09, 2004 5:18 pm
Re: format-date
Hi,
I'm not sure what you mean by "it does not work" but "format-date()" is an XSLT 2.0 function:
https://www.w3.org/TR/xslt20/#function-format-date
so you cannot use it in an XSLT 1.0 stylesheet.
Regards,
Radu
I'm not sure what you mean by "it does not work" but "format-date()" is an XSLT 2.0 function:
https://www.w3.org/TR/xslt20/#function-format-date
so you cannot use it in an XSLT 1.0 stylesheet.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9414
- Joined: Fri Jul 09, 2004 5:18 pm
Re: format-date
Hi,
You need to do it the hard way using substring-before, substring-after and so on.
I found a stackoverflow post about this:
https://stackoverflow.com/questions/164 ... n-xslt-1-0
Regards,
Radu
You need to do it the hard way using substring-before, substring-after and so on.
I found a stackoverflow post about this:
https://stackoverflow.com/questions/164 ... n-xslt-1-0
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “General XML Questions”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ 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