XSLT accessing map elements while processing topics

Here should go questions about transforming XML with XSLT and FOP.
Posts: 5
Joined: Fri Nov 06, 2009 8:33 pm

XSLT accessing map elements while processing topics

Post by sfogel2 » Fri Sep 14, 2018 4:27 am

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

Site Admin
Posts: 136
Joined: Thu Dec 24, 2009 11:21 am

Re: XSLT accessing map elements while processing topics

Post by alin » Wed Sep 19, 2018 12:52 pm


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)}"/>.
Alin Balasa
Software Developer
<oXygen/> XML Editor

Post Reply