Document disclaimer should have no number

Post here questions and problems related to editing and publishing DITA content.
Victor
Posts: 7
Joined: Wed Aug 05, 2015 10:37 am

Document disclaimer should have no number

Post by Victor »

Hi,
I'm using Oxygen Author 15.2 and I publish PDFs from DITAmaps containing <topicref> elements.
In the Pdf, all my topics get (nested) numbers, also the disclaimer at the start of the document.
I'd like to have a disclaimer without any number.
Any ideas how to realise this?

Thanks in advance, Victor
Radu
Posts: 9446
Joined: Fri Jul 09, 2004 5:18 pm

Re: Document disclaimer should have no number

Post by Radu »

Hi Victor,

Oxygen 15.2 comes with the DITA Open Toolkit 1.7 publishing engine bundled in the folder:

OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT

Are you publishing a DITA Map or a Book Map.
If you are publishing a BookMap maybe you could add the reference to your disclaimer in the frontmatter section.

An Oxygen installation comes with a samples folder which contains a sample Bookmap:

OXYGEN_INSTALL_DIR\samples\dita\it-book\taskbook.ditamap

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Victor
Posts: 7
Joined: Wed Aug 05, 2015 10:37 am

Re: Document disclaimer should have no number

Post by Victor »

Hi Radu,

I'm publishing from a DITAmap.
I would like to add an element or topic class and then alter the existing numbering, exclusively for this particular class or element.

In the "custom.xsl" file of the transformation scenario, I would like to edit the conditions for numbering just like the example below (the example shows adding A, B etc. in front of the appendices headers).
Could you give a suggestion how to edit a new test condition for this particular class?

Kind regards, Victor

<xsl:when test="count($level)=1 and parent::*/@id[. = //*/appendix/@id]">
<xsl:for-each select="$level">
<xsl:number
value="count(preceding-sibling::*[contains(@class,' topic/topic ')][@id =
//*/appendix/@id]) + 1"
format="A"/>
<xsl:text> </xsl:text>
</xsl:for-each>
</xsl:when>
Radu
Posts: 9446
Joined: Fri Jul 09, 2004 5:18 pm

Re: Document disclaimer should have no number

Post by Radu »

Hi Victor,

Maybe in the DITA Map on that particular topicref you can set an outputclass attribute with a custom value. Then try to match on that particular outputclass value from the XSLT code.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Victor
Posts: 7
Joined: Wed Aug 05, 2015 10:37 am

Re: Document disclaimer should have no number

Post by Victor »

Hi Radu,

I've adapted the topicref like this:

<topicref outputclass="drop_numbering" href="copyright.dita"/>

Could you give me a hint how to edit the test condition of the previous "custom.xsl" file to address this particular class?

Thank you,
Kind regards, Victor
Radu
Posts: 9446
Joined: Fri Jul 09, 2004 5:18 pm

Re: Document disclaimer should have no number

Post by Radu »

Hi Victor,

I'm not sure how to help you further because the XSLT customization to add numbering in the PDF for each topicref is yours.
When your custom xslt template is called you probably need to find the proper XPath expression to execute in order to find out if the topicref has that specific outputclass attribute or not.
If you configure the transformation scenario and set the "clean.temp" parameter to "no" in the temporary files folder you will find the merged DITA Map (which is the map with all topic references expanded in it) on which your XSLT customization is applied. This will give you a better idea about the entire structure of the XML document on which the XSLT customization is applied.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Victor
Posts: 7
Joined: Wed Aug 05, 2015 10:37 am

Re: Document disclaimer should have no number

Post by Victor »

Hi Radu,

I already found a solution, as follows:

- I moved the attribute (outputclass="drop_numbering") from the <topicref> element to the <topic> element itself, like this:
<topic outputclass="drop_numbering" id="Disclaimer">

- Then I edited the "custom.xsl" file like this:

Code: Select all


<xsl:when test="parent::*[contains(@outputclass,'drop_numbering')][@id = //*/*/@id]">
<xsl:text></xsl:text>
<xsl:apply-templates />
</xsl:when>
After this, the disclaimer topic had no number and the next topic in the DITAmap had, but it started at "2".
Therefore, I adapted the numbering loop in the "custom.xsl" file with an extra condition like this:

Code: Select all


<xsl:when test="not(count($level) > $maxTopicLevelNumber)">
<xsl:number count="*[contains(@class,' topic/topic ') and not(contains(@outputclass,'drop_numbering'))
level="multiple" format="1.1" />
</xsl:when>
And now the solution is complete.

Thank you very much for your support.

Kind regards,
Victor
Radu
Posts: 9446
Joined: Fri Jul 09, 2004 5:18 pm

Re: Document disclaimer should have no number

Post by Radu »

Hi Victor,

Great, thanks for posting your solution.

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