how to add product release information in PDF cover page

lisazeng
Posts: 29

how to add product release information in PDF cover page

Wed Jul 26, 2017 2:26 pm

Hi Expert,

In oxygen, i set the release inforamtion in the ditamap, like below

Code: Select all

<map title="Lisa Guide" product="Lisa test" otherprops="DN1234567">
    <title>Goodix MCU SDK Developer Guide</title>
    <topicmeta>
        <prodinfo>
            <prodname>@product.name@</prodname>
            <vrmlist>
                <vrm version="3" release="1.1"/>
            </vrmlist>
            <brand>@company.name@</brand>
            <component>@product.component@</component>
        </prodinfo>
    </topicmeta>

if I want to get the otherprops value, i can use

Code: Select all

                     <xsl:value-of select="//*[contains(@class, ' map/map ')]/@otherprops"/>.

How can I get the version value?
I used

Code: Select all

<xsl:value-of select="$map/*[contains(@class,' topic/vrm ')]/@version" />
, and my version is 3, it prints a lot of 3 in my pdf.

Thanks!

Lisa
Radu
Posts: 5585

Re: how to add product release information in PDF cover page

Wed Jul 26, 2017 2:51 pm

Hi Lisa,

You can try this:

Code: Select all

<xsl:value-of select="($map/*[contains(@class,' topic/vrm ')]/@version)[1]" />


to match only the first version attribute from the merged DITA Map.
To understand more precisely on what content your XPath will match, you can output an xsl:message like:

Code: Select all

<xsl:message>Merged map: <xsl:copy-of select="$map"/></xsl:message>
.

If in the Oxygen Preferences->"DITA" page you choose to always show the console output, after publishing the "DITA OT" console view at the bottom of Oxygen should also show your xsl:messages.
So you can use xsl:messages to debug what you are doing.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
lisazeng
Posts: 29

Re: how to add product release information in PDF cover page

Thu Jul 27, 2017 7:00 am

Hi Radu,


The following code has no output in the pdf,but the array index helps me.

Code: Select all

<xsl:value-of select="($map/*[contains(@class,' topic/vrm ')]/@version)[1]" />

I changes a bit. so below code, works.

Code: Select all

<xsl:value-of select="(//*[contains(@class,' topic/vrm ')]/@version)[1]"/>

Thanks very much!!

Lisa

Return to “DITA (Editing and Publishing DITA Content)”

Who is online

Users browsing this forum: No registered users and 1 guest