XSLT accessing map elements while processing topics

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

XSLT accessing map elements while processing topics

Post 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
alin
Site Admin
Posts: 268
Joined: Thu Dec 24, 2009 11:21 am

Re: XSLT accessing map elements while processing topics

Post 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
Alin Balasa
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply