Can't Get @type from ditamap topicmeta in CSS
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 30
- Joined: Sat Feb 16, 2019 8:43 pm
Can't Get @type from ditamap topicmeta in CSS
Hi,
I'm trying to add content from ditamap topicmeta.
[Codebox=]<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map title="Test" xml:lang="en">
<title>Test</title>
<topicmeta>
<prodinfo>
<prodname></prodname>
<vrmlist>
<vrm version="0000"/>
</vrmlist>
</prodinfo>
<data type="subtitle">Example</data>
<data type="watermark"/>
<data type="keywords"/>
<data type="subject"/>
<data type="partno">1234</data>
</topicmeta>
</map>
[/Codebox]
In my CSS, I have the following, but when I build the pdf using html/css, it does not work. If I remove the xpath, and enter "test", it does work. I used the xpath builder in Oxygen Editor 21, and I used that xpath in the CSS. Can someone tell me if they see a problem in my xpath? Thanks a lot.
[Codebox=]/* Add subtitle */
*[class ~= "front-page/front-page-title"]:after(1){
display:block;
content: oxy_xpath('//*:front-page/map[1]/topicmeta[1]/data[1]/@type='subtitle'');
font-size: 1em;
color:black;
}[/Codebox]
I'm trying to add content from ditamap topicmeta.
[Codebox=]<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map title="Test" xml:lang="en">
<title>Test</title>
<topicmeta>
<prodinfo>
<prodname></prodname>
<vrmlist>
<vrm version="0000"/>
</vrmlist>
</prodinfo>
<data type="subtitle">Example</data>
<data type="watermark"/>
<data type="keywords"/>
<data type="subject"/>
<data type="partno">1234</data>
</topicmeta>
</map>
[/Codebox]
In my CSS, I have the following, but when I build the pdf using html/css, it does not work. If I remove the xpath, and enter "test", it does work. I used the xpath builder in Oxygen Editor 21, and I used that xpath in the CSS. Can someone tell me if they see a problem in my xpath? Thanks a lot.
[Codebox=]/* Add subtitle */
*[class ~= "front-page/front-page-title"]:after(1){
display:block;
content: oxy_xpath('//*:front-page/map[1]/topicmeta[1]/data[1]/@type='subtitle'');
font-size: 1em;
color:black;
}[/Codebox]
Adam Myers
Technical Publications Manager
MATRIXX Software
Technical Publications Manager
MATRIXX Software
-
- Posts: 846
- Joined: Mon Dec 05, 2011 6:04 pm
Re: Can't Get @type from ditamap topicmeta in CSS
Hello,
You should match the text content of the subtitle, so your xpath should look like:
For more information on getting metadata and using it on the cover page, see this section from the User-Guide.
Regards,
Costin
You should match the text content of the subtitle, so your xpath should look like:
Code: Select all
content: oxy_xpath('//*[contains(@class, " map/topicmeta")]/*[contains(@type, "subtitle")]/text()');
Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
oXygen XML Editor and Author Support
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