Issue with string-set and variable declaration in css (PDF creation)
Having trouble installing Oxygen PDF Chemistry? Got a bug to report? Post it all here.
Issue with string-set and variable declaration in css (PDF creation)
I'm using a demo version of Publishing Engine and have run into the following issue while creating PDFs
I'm testing the use of css variables and string-set and when referencing them in the css no value is returned.
I've tried the above without the oxy_concat
content: var(--effectiveDate); or content: string(effectiveDate)
both these return nothing.
Is this a limitation with the demo version?
Mario
I'm testing the use of css variables and string-set and when referencing them in the css no value is returned.
Code: Select all
:root {
string-set: effectiveDate "EFFECTIVE DATE";
--effectiveDate: "EFFECTIVE DATE";
}
/* this one returns : TEST - Some more stuff - null */
.front-page > div.front-page-title > div {
color: blue;
font-size: 4rem;
content: oxy_concat('TEST - ', 'Some more stuff - ', string(effectiveDate));
}
/* this one returns nothing */
.front-page > div.front-page-title2 > div {
color: blue;
font-size: 4rem;
content: oxy_concat('TEST - ', 'Some more stuff - ', var(--effectiveDate));
}
content: var(--effectiveDate); or content: string(effectiveDate)
both these return nothing.
Is this a limitation with the demo version?
Mario
-
- Posts: 566
- Joined: Wed Oct 16, 2019 3:47 pm
Re: Issue with string-set and variable declaration in css (PDF creation)
Post by julien_lacour »
Hello Mario,
This is not a limitation of the trial version, the string() function can only be used within a static context like page-margin boxes (defined within CSS @page at-rule). You can't use it at element level. If you use it in the correct context, you don't need to use oxy_concat() function, you can directly write each value:
You cannot use a variable neither as indicated in the CSS Validator warning: "Due to their dynamic nature, CSS variables are currently not statically checked".
If you want to add dynamic content in some elements you should take a look at the oxy_xpath() function, you can for example add the current date:
Regards,
Julien
This is not a limitation of the trial version, the string() function can only be used within a static context like page-margin boxes (defined within CSS @page at-rule). You can't use it at element level. If you use it in the correct context, you don't need to use oxy_concat() function, you can directly write each value:
Code: Select all
@page front-page {
@top-left {
content: 'TEST - ' 'Some more stuff - ' string(effectiveDate));
}
}
If you want to add dynamic content in some elements you should take a look at the oxy_xpath() function, you can for example add the current date:
Code: Select all
*[class~="front-page/front-page-title"]::after{
display: block;
content: oxy_xpath('current-date()');
}
Julien
-
- Posts: 566
- Joined: Wed Oct 16, 2019 3:47 pm
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