DITA map PDF – based on HTML5 &CSS transformation with xslt extension points
Posted: Mon Nov 26, 2018 11:40 am
Dear all,
I am building templates for a datasheet written in DITA. I am using the Oxygen DITA map PDF – based on HTML5 &CSS transformation. This really works great I have to say, it is the first time I can almost get everything I want to get working in the layout work for DITA!
However now I encounter a problem for which I need an xslt extension point. And then my knowledge get limited.
What I want is the following. Now my datasheet.merged.html contains the following code:
And I want:
Looking at examples I made the following extension xslt:
In the opt file I have the following:
This partially does the Job, with the following problems:
1. match="*[contains(@class, ' topic/title ')]" makes that this change is applied to all topic titles. I only want it to be applied to the topic/title in the “front-page/front-page-title front-page-title” div. I tried using the front-page/front-page-title front-page-title in the match, but that did not change the output in any way. How can I get this working?
2. I don’t understand why this change does not work if in the opt file I use the id “com.oxygenxml.pdf.css.xsl.merged2html5”. Could somebody explain that? I read the user manual and I know there are two phases to apply changes but I thought this change had to be applied after the conversion to HTML while now it only seems to work before that conversion.
3. In my pdf I get the following text: [/map/concept/div {"doctype"}) datasheet (div], marked yellow, where does that come from?
Maybe anybody of you can give me new ideas where to search and what to try next.
Thanks,
Benny
I am building templates for a datasheet written in DITA. I am using the Oxygen DITA map PDF – based on HTML5 &CSS transformation. This really works great I have to say, it is the first time I can almost get everything I want to get working in the layout work for DITA!
However now I encounter a problem for which I need an xslt extension point. And then my knowledge get limited.
What I want is the following. Now my datasheet.merged.html contains the following code:
Code: Select all
<div class=" front-page/front-page-title front-page-title">
<div class="- topic/title title">product name</div>
</div>
Code: Select all
<div class=" front-page/front-page-title front-page-title">
<div class="doctype">datasheet</div>
<div class="- topic/title title">product name</div>
</div>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:oxyf="http://www.oxygenxml.com/functions"
exclude-result-prefixes="xs"
version="2.0">
<xsl:template match="*[contains(@class, ' topic/title ')]">
<div class="doctype">Datasheet</div>
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Code: Select all
<xslt>
<extension id="com.oxygenxml.pdf.css.xsl.merged2merged" file="xslt/document-type.xsl"/>
</xslt>
1. match="*[contains(@class, ' topic/title ')]" makes that this change is applied to all topic titles. I only want it to be applied to the topic/title in the “front-page/front-page-title front-page-title” div. I tried using the front-page/front-page-title front-page-title in the match, but that did not change the output in any way. How can I get this working?
2. I don’t understand why this change does not work if in the opt file I use the id “com.oxygenxml.pdf.css.xsl.merged2html5”. Could somebody explain that? I read the user manual and I know there are two phases to apply changes but I thought this change had to be applied after the conversion to HTML while now it only seems to work before that conversion.
3. In my pdf I get the following text: [/map/concept/div {"doctype"}) datasheet (div], marked yellow, where does that come from?
Maybe anybody of you can give me new ideas where to search and what to try next.
Thanks,
Benny