XSLT accessing map elements while processing topics

Here should go questions about transforming XML with XSLT and FOP.
sfogel2
Posts: 5

XSLT accessing map elements while processing topics

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
steve@p3datasys.com
alin
Site Admin
Posts: 132

Re: XSLT accessing map elements while processing topics

Wed Sep 19, 2018 12:52 pm

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

Return to “XSLT and FOP”

Who is online

Users browsing this forum: Majestic-12 [Bot] and 3 guests