Page 1 of 1

Error message when generating the documentation

Posted: Fri Oct 23, 2015 9:47 pm
by BogdanM777
Hi guys,

I have a small issue when I am generating the documentation for a product of ours using Jenkins.
I get this type of error, and I do not quite understand why it is coming as the documentation is generating anyways:

[xslt] : Error! Ambiguous rule match for /bookmap/opentopic:map[1]/chapter[11]/glossref[7]
[xslt] Matches both "*[contains(@class, ' bookmap/chapter ')] | *[contains(@class, ' map/topicref ')] [not(ancestor-or-self::*[contains(@class,' bookmap/frontmatter ')])]" on line 55 of file:E:/JENKINS_HOME/jobs/DOCUMENTATION/workspace/dita_toolkit/DITA-OT/plugins/org.dita.pdf2/cfg/fo/xsl/custom.xsl

In the line mentioned in custom.xsl there are some changes I did after some suggestions from you regarding the numbering of topics and subtopics (see post35014.html#p35014).
If you would have some advices for that, it would be wonderful.

Thank you

Re: Error message when generating the documentation

Posted: Tue Oct 27, 2015 12:22 pm
by Radu
Hi Bogdan,

I think the warning you posted is incomplete, it should have also stated the other matched template.
The bottom line is that the template you added in the custom.xsl also matches DITA <glossref> elements because it contains the selector:

Code: Select all

 *[contains(@class, ' map/topicref ')]
and a glossref is also a topicref. And there is probably another template somewhere else which also matches glossref. And both templates have the same priority so probably only one of them will be called.
In such cases you could set a @priority attribute on your XSLT template like:

Code: Select all


<xsl:template priority="100".....
if you want the processing to prefer your template for glossrefs.
Or if you want the processing to prefer the standard template for glossrefs you need to make the matching more precise like:

Code: Select all

 *[contains(@class, ' map/topicref ')][not(contains(@class, ' glossref-d/glossref '))]
Regards,
Radu