Testing XPATH expressions in DITA bookmaps

susannecm
Posts: 48

Testing XPATH expressions in DITA bookmaps

Fri Oct 20, 2017 8:30 pm

Hi,

I have a bookmap that contains references to other maps, and I am looking for an XPATH expression that gives me the parent chapter for a given topicref. Can I test this in the XPATH toolbar in oXygen? The bookmap is open in the DITA Maps Manager, and the scope is set to Current DITA map hierarchy. I've tried to select a topicref in the editor and in the DITA Maps Manager, but even simple XPATH expressions (such as ..) return no results. Is what I want even possible if the bookmap references other maps?

Kind regards
Susanne Muris
Radu
Posts: 5088

Re: Testing XPATH expressions in DITA bookmaps

Mon Oct 23, 2017 11:49 am

Hi Susanne,

You probably need some kind of processing to first merge all the DITA Maps into one and then run the xpath expression.
If you open the main DITA Map in the DITA Maps Manager view and show the "Configure Transformation Scenario" dialog, you can create a new scenario of type "DITA OT" and you can choose the type "Merge DITA Content to Single File".
After publishing you will have a single XML file with all the submaps expanded in place and you can try to run XPath expressions on it.
Or you can create your own XSLT which applies on the main DITA Map and only expands in place references to submaps.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
susannecm
Posts: 48

Re: Testing XPATH expressions in DITA bookmaps

Tue Oct 24, 2017 1:08 pm

Thanks, that works nicely. What a useful transformation :) .
Kind regards
Susanne Muris
Radu
Posts: 5088

Re: Testing XPATH expressions in DITA bookmaps

Tue Oct 24, 2017 11:33 pm

Hi Susanne,

Yes. It is also useful to build statistics, like the number of words in the project or similar stuff like that.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Return to “DITA (Editing and Publishing DITA Content)”

Who is online

Users browsing this forum: No registered users and 3 guests