Page 1 of 1

XSLT accessing map elements while processing topics

Posted: Fri Sep 14, 2018 4:27 am
by sfogel2
Hi, all...

It’s been quite a few years since I wrote any XSLT code for the DITA OT. Thus, my question. With the out-of-the-box XHTML transform, when processing a topic, does the stylesheet have access to the map's <topicmeta> content? I’ve good some good stuff stored in map/topicmeta.

If so, what is the syntax? If not, what is the recommended transform to use instead or way to tweak the out-of-the-box transform?:

Many thanks.

Steve Fogel
System Architect
P3 Data Systems
steve@p3datasys.com

Re: XSLT accessing map elements while processing topics

Posted: Wed Sep 19, 2018 12:52 pm
by alin
Hello,

In case of the WebHelp Responsive transformation you can use the new template whc:macro component to execute XPath expressions in the context of the DITA map.
You can use the whc:macro components in a template HTML Page layout file or in an HTML fragment file.

You can read more about macros in our User Manual: https://www.oxygenxml.com/doc/versions/ ... gment_file
You can also take a look at this template sample: https://github.com/oxygenxml/oxygen-pub ... ith-macros

For example, if you want to retrieve the name of the organization from the metadata stored in a bookmap you can use the following construct:

Code: Select all


<whc:macro value="${map-xpath(/bookmap/bookmeta/bookrights/bookowner/organization)}"/>.
Regards,
Alin