Adding separators between vrnlist attributes (CSS based PDF)
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 15
- Joined: Wed Mar 06, 2019 4:35 pm
Adding separators between vrnlist attributes (CSS based PDF)
I set the version number in the topicmeta of the map:
I need to display vrm attributes on the cover page, separated with dots, eg. "6.3.2"
But if only two attributes are set it should be "6.3"
I got this so far but of course it always adds a dot no matter if an attribute is set or not:
I don't know how to set a conditon at this point, so I could really use a hint here 
Code: Select all
<prodinfo>
<prodname>ABC </prodname>
<vrmlist>
<vrm version="6" release="2"/>
</vrmlist>
</prodinfo>
But if only two attributes are set it should be "6.3"
I got this so far but of course it always adds a dot no matter if an attribute is set or not:
Code: Select all
*[class ~= "front-page/front-page-title"]:after {
display:block;
content: "Number: " oxy_xpath('(//*[contains(@class, " map/topicmeta ")]/*[contains(@class, " topic/prodinfo ")]/*[contains(@class, " topic/vrmlist ")]/*[contains(@class, " topic/vrm")]/@version)[1]')"." oxy_xpath('(//*[contains(@class, " map/topicmeta ")]/*[contains(@class, " topic/prodinfo ")]/*[contains(@class, " topic/vrmlist ")]/*[contains(@class, " topic/vrm")]/@release)[1]') "."oxy_xpath('(//*[contains(@class, " map/topicmeta ")]/*[contains(@class, " topic/prodinfo ")]/*[contains(@class, " topic/vrmlist ")]/*[contains(@class, " topic/vrm")]/@modification)[1]');
}

-
- Posts: 665
- Joined: Wed Oct 16, 2019 3:47 pm
Re: Adding separators between vrnlist attributes (CSS based PDF)
Post by julien_lacour »
Hello,
I'm glad you succeed using XSL and the extension point.
If you still want to do this only using CSS you can use the following selector:
For simple conditions, XPath support the 'if then else' structure.
Regards,
Julien
I'm glad you succeed using XSL and the extension point.
If you still want to do this only using CSS you can use the following selector:
Code: Select all
*[class ~= "front-page/front-page-title"]:after {
display:block;
content: "Number: " oxy_xpath('(//*[contains(@class, " map/topicmeta ")]/*[contains(@class, " topic/prodinfo ")]/*[contains(@class, " topic/vrmlist ")]/*[contains(@class, " topic/vrm")]/@version)[1]')
"." oxy_xpath('(//*[contains(@class, " map/topicmeta ")]/*[contains(@class, " topic/prodinfo ")]/*[contains(@class, " topic/vrmlist ")]/*[contains(@class, " topic/vrm")]/@release)[1]')
oxy_xpath('if ((//*[contains(@class, " map/topicmeta ")]/*[contains(@class, " topic/prodinfo ")]/*[contains(@class, " topic/vrmlist ")]/*[contains(@class, " topic/vrm")]/@modification)[1]) then concat(".", (//*[contains(@class, " map/topicmeta ")]/*[contains(@class, " topic/prodinfo ")]/*[contains(@class, " topic/vrmlist ")]/*[contains(@class, " topic/vrm")]/@modification)[1]) else ""');
}
Regards,
Julien
-
- Posts: 665
- Joined: Wed Oct 16, 2019 3:47 pm
Re: Adding separators between vrnlist attributes (CSS based PDF)
Post by julien_lacour »
You are right, we will add an example using 'if then else' structure in oxy_xpath() functions inside our documentation.
Return to “DITA (Editing and Publishing DITA Content)”
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