Can't Get @type from ditamap topicmeta in CSS

amyers3
Posts: 16
Joined: Sat Feb 16, 2019 8:43 pm

Can't Get @type from ditamap topicmeta in CSS

Post by amyers3 » Sat Mar 02, 2019 2:48 am

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]
Adam Myers
Technical Publications Manager
MATRIXX Software

Costin
Posts: 688
Joined: Mon Dec 05, 2011 6:04 pm

Re: Can't Get @type from ditamap topicmeta in CSS

Post by Costin » Mon Mar 04, 2019 1:59 pm

Hello,

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()');
For more information on getting metadata and using it on the cover page, see this section from the User-Guide.

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support

amyers3
Posts: 16
Joined: Sat Feb 16, 2019 8:43 pm

Re: Can't Get @type from ditamap topicmeta in CSS

Post by amyers3 » Mon Mar 04, 2019 6:54 pm

Thanks Costin!

Adam
Adam Myers
Technical Publications Manager
MATRIXX Software

Post Reply