Test for contents of a Map
Posted: Thu Apr 25, 2024 12:50 am
I have a map inside my bookmap that contains keywords assigned to SKUs.
In my frontmatter.xsl file, I am attempting to test if the class exists so I can obtain the value to print on my cover page. However, I cannot figure out the right test criteria. I thought that should work as I am assuming the skus.ditamap is a topic. I have tried other combinations such as , etc.
Perhaps this assumption is wrong. If so, I would appreciate any help in sorting this out.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map>
<keydef keys="sku1">
<topicmeta>
<keywords>
<keyword>ABC-1234567890123456</keyword>
</keywords>
</topicmeta>
</keydef>
<keydef keys="sku2">
<topicmeta>
<keywords>
<keyword>DEF-1234567890123456</keyword>
</keywords>
</topicmeta>
</keydef>
<keydef keys="sku3">
<topicmeta>
<keywords>
<keyword>GHI-1234567890123456</keyword>
</keywords>
</topicmeta>
</keydef>
</map>
Code: Select all
topic/keyword
Code: Select all
topicmeta map keydef
Code: Select all
<xsl:if test="//*[contains(@class, ' topic/keyword ')][1]">