Variables for title page

Having trouble installing Oxygen? Got a bug to report? Post it all here.
Boreas
Posts: 86
Joined: Wed Feb 09, 2011 10:43 pm

Variables for title page

Post by Boreas »

Hello,

I was wondering, are there other variables that can be used under the template name="createFrontMatter_1.0"> used to generate the title page?
In the front-matter.xsl file we have

Code: Select all


$productName
$productVersion
$pubdate
I would need another variable for revision. I previously patched the problem by putting the revision in the productname (I know, not pretty), but now that we need to use productName in the metadata in the Dita map, well I am stuck. That should teach me. :wink:

As I said, for automation purposes, we are adding meta data in our dita maps.

Code: Select all


<topicmeta>
<prodinfo>
<prodname>Mediatrix C7</prodname>
<vrmlist>
<vrm version="Dgw 2.0.32"/>
</vrmlist>
<platform>C 710</platform>
</prodinfo>
</topicmeta>
I noticed that the prodname and version included as metadata in the ditamap are used to generate the title page, if nothing is specified in the front-matters.xsl file. I would like to manage all the information displayed on the title page using metada in the ditamap. Is this possible?

I need, prodname, version, revision and date.

Regards

Carole
Boreas
Posts: 86
Joined: Wed Feb 09, 2011 10:43 pm

Re: Variables for title page

Post by Boreas »

Hello,

I found that if I use,

Code: Select all

<critdates><revised modified="" golive=" May 10, 2013"/></critdates>


as metadata in the dita map,
the date will be displayed on the title page, provided you don't put anything in th front-matter.xsl file. It's apparently the golive attribute that does the job.

Still looking for a revision element.....

Regards

Carole
Radu
Posts: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: Variables for title page

Post by Radu »

Hi Carole,

Just as an example, the productName variable is defined in:

OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/plugins/org.dita.pdf2/xsl/fo/root-processing.xsl

as:

Code: Select all

 <xsl:variable name="productName">
<xsl:variable name="mapProdname" select="(/*/opentopic:map//*[contains(@class, ' topic/prodname ')])[1]"/>
............
so the variable takes its value from an XPath expression which finds its value in the main DITA Map.

So you can use XPath expressions in the "createFrontMatter_1.0" XSLT template to match various XML tags or attributes from the DITA Map, like for example to match the @modified attribute on the <revised> attribute:

Code: Select all

<xsl:value-of select="(/*/opentopic:map//*[contains(@class, ' topic/revised ')]/@modified)[1]"/>
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Boreas
Posts: 86
Joined: Wed Feb 09, 2011 10:43 pm

Re: Variables for title page

Post by Boreas »

:D
Actually, with the information you gave me I was able to display two attributes for the pubDate.

Code: Select all


  <xsl:variable name="pubDate">
<xsl:value-of select="(/*/opentopic:map//*[contains(@class, ' topic/revised ')]/@modified)[1]"/>
<xsl:value-of select="(/*/opentopic:map//*[contains(@class,' topic/revised ')]/@golive)[1]"/>

</xsl:variable>
The result is sort of what I wanted.

Mediatrix C7
Dgw 2.0.32
August 15, 2015 - Revision 2

Ideally, I wanted the revision and the date on two separae line. So unless there is an easy way to do it, I will play around with the text to make it look ok.


thank you for your precious help.

Carole
Radu
Posts: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: Variables for title page

Post by Radu »

Hi Carole,

When you want to create separate lines with XSL-FO you need to add an fo:block around that area, something like:

Code: Select all

     <xsl:variable name="pubDate">
<fo:block>
<xsl:value-of select="(/*/opentopic:map//*[contains(@class, ' topic/revised ')]/@modified)[1]"/>
</fo:block>
<fo:block>
<xsl:value-of select="(/*/opentopic:map//*[contains(@class,' topic/revised ')]/@golive)[1]"/>
</fo:block>
</xsl:variable>
but I'm not sure where you are using the variable though, you cannot use it in an fo:inline element.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply