Testing XPATH expressions in DITA bookmaps

Post here questions and problems related to editing and publishing DITA content.
susannecm
Posts: 107
Joined: Wed Mar 17, 2010 1:04 pm

Testing XPATH expressions in DITA bookmaps

Post by susannecm »

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: 8991
Joined: Fri Jul 09, 2004 5:18 pm

Re: Testing XPATH expressions in DITA bookmaps

Post by Radu »

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: 107
Joined: Wed Mar 17, 2010 1:04 pm

Re: Testing XPATH expressions in DITA bookmaps

Post by susannecm »

Thanks, that works nicely. What a useful transformation :) .
Kind regards
Susanne Muris
Radu
Posts: 8991
Joined: Fri Jul 09, 2004 5:18 pm

Re: Testing XPATH expressions in DITA bookmaps

Post by Radu »

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
Post Reply