format-date(current-date()) problem
Having trouble installing Oxygen PDF Chemistry? Got a bug to report? Post it all here.
-
- Posts: 10
- Joined: Thu Aug 30, 2018 7:25 pm
format-date(current-date()) problem
Hello!
I'm trying to set the 'current-date' string at the title page for displaying the current date by using 'ru' localization. But something work wrong. when the compilation of pdf is completed, this line is displayed '[Language: en] August 2018'. In default parameters with no locale argument ('en' language is default) there are no problems.
code is shown below:
....
*[class ~= "bookmap/booktitle"]:after(2) {
display:block;
content: oxy_xpath("format-date(current-date(), '[MNn] [Y0001]' "ru", (), ())");
....
Initial data are as follows:
The latest version of OxygenXML + chemistry, the compiler via DITA Map PDF is based on DITA & CSS (WYSIWYG) + own css.
Who faced this problem? Any help will be pleasure.
I'm trying to set the 'current-date' string at the title page for displaying the current date by using 'ru' localization. But something work wrong. when the compilation of pdf is completed, this line is displayed '[Language: en] August 2018'. In default parameters with no locale argument ('en' language is default) there are no problems.
code is shown below:
....
*[class ~= "bookmap/booktitle"]:after(2) {
display:block;
content: oxy_xpath("format-date(current-date(), '[MNn] [Y0001]' "ru", (), ())");
....
Initial data are as follows:
The latest version of OxygenXML + chemistry, the compiler via DITA Map PDF is based on DITA & CSS (WYSIWYG) + own css.
Who faced this problem? Any help will be pleasure.
-
- Posts: 501
- Joined: Mon Feb 03, 2003 10:56 am
Re: format-date(current-date()) problem
There is a syntax error in your XPath expression, it misses a comma and you should use singe quotes around the 'ru' token, since the entire expression is already enclosed in double quotes:
The correct form is:
Please use the XPath builder view from oXygen when developing XPath expressions.
Best regards,
Dan
The correct form is:
Code: Select all
...
content: oxy_xpath("format-date(current-date(), '[MNn] [Y0001]', 'ru', (), ())");
...
Best regards,
Dan
-
- Posts: 10
- Joined: Thu Aug 30, 2018 7:25 pm
Re: format-date(current-date()) problem
Thanks for answer Dan!Dan wrote:There is a syntax error in your XPath expression, it misses a comma and you should use singe quotes around the 'ru' token, since the entire expression is already enclosed in double quotes:
The correct form is:Please use the XPath builder view from oXygen when developing XPath expressions.Code: Select all
...
content: oxy_xpath("format-date(current-date(), '[MNn] [Y0001]', 'ru', (), ())");
...
Best regards,
Dan
It's my mistake in this example with double quotes, in my code is all ok with syntax. But this does not work with single quotes.
-
- Posts: 501
- Joined: Mon Feb 03, 2003 10:56 am
Re: format-date(current-date()) problem
It looks like Saxon HE is limited by design: https://sourceforge.net/p/saxon/mailman ... /26849522/
The only workaround is to format the date like this:
Make sure the entire expression is rendered blue in the CSS editor. Replace the caps with the Russian month names.
Best regards,
Dan
The only workaround is to format the date like this:
Code: Select all
...
content: oxy_xpath("let $cm:= format-date(current-date(), '[MNn]') \
return concat( \
if ($cm= 'January') then 'JAN' else \
if ($cm= 'February') then 'FEB' else \
if ($cm= 'March') then 'MAR' else \
if ($cm= 'April') then 'APR' else \
if ($cm= 'May') then 'MAY' else \
if ($cm= 'June') then 'JUNE' else \
if ($cm= 'July') then 'JUL' else \
if ($cm= 'August') then 'AUG' else \
if ($cm= 'September') then 'SEPT' else \
if ($cm= 'October') then 'OCT' else \
if ($cm= 'November') then 'NOV' else '' \
, \
' ', \
format-date(current-date(), '[Y0001]') \
) ");
...
Best regards,
Dan
-
- Posts: 10
- Joined: Thu Aug 30, 2018 7:25 pm
Re: format-date(current-date()) problem
It works, it works!!!! Amazing!Dan wrote:It looks like Saxon HE is limited by design: https://sourceforge.net/p/saxon/mailman ... /26849522/
The only workaround is to format the date like this:
Make sure the entire expression is rendered blue in the CSS editor. Replace the caps with the Russian month names.Code: Select all
...
content: oxy_xpath("let $cm:= format-date(current-date(), '[MNn]') \
return concat( \
if ($cm= 'January') then 'JAN' else \
if ($cm= 'February') then 'FEB' else \
if ($cm= 'March') then 'MAR' else \
if ($cm= 'April') then 'APR' else \
if ($cm= 'May') then 'MAY' else \
if ($cm= 'June') then 'JUNE' else \
if ($cm= 'July') then 'JUL' else \
if ($cm= 'August') then 'AUG' else \
if ($cm= 'September') then 'SEPT' else \
if ($cm= 'October') then 'OCT' else \
if ($cm= 'November') then 'NOV' else '' \
, \
' ', \
format-date(current-date(), '[Y0001]') \
) ");
...
Best regards,
Dan
Thanks a lot, you are best!
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