Run Xpath with DITA Map Hierarchy Scope from Project View

Are you missing a feature? Request its implementation here.
dreifsnider
Posts: 105
Joined: Thu Aug 30, 2018 10:06 pm

Run Xpath with DITA Map Hierarchy Scope from Project View

Post by dreifsnider »

Hi,

I'd like to be able to run an Xpath against selected DITA Maps and each one's entire hierarchy from within the Project view.

This came up when I was trying to find DITA Maps in my Project that have a referenced topic which references an SVG file.

To accomplish this, I had to open each DITA Map individually in the DITA Maps Manager (~30 DITA Maps) and then run the Xpath against each one individually with the scope set to Current DITA map hierarchy.

Ideally, I would've liked to have been able to accomplish the same thing by selecting the DITA Maps in the Project view and then running an Xpath on each one's hierarchy all from the Project view.

Thanks!

Daniel
xephon
Posts: 140
Joined: Mon Nov 24, 2014 1:49 pm
Location: Greven/Germany

Re: Run Xpath with DITA Map Hierarchy Scope from Project View

Post by xephon »

Hi,
May I ask what you are trying to achieve?
We have also to work on SVG files and fix them with XSLT. Otherwise Apache Batik has rendering or scaling issues. What we do is selecting the SVG files in the project view and then perform an XSLT transformstion on them, similar to the FrameMaker-MIF-wash function. This script is an identity transformation, which fixes - on the fly - all issues.

If this is not what you are looking for, maybe you want to write an Apache Ant script, which operates on the project directory to list those files

A third option could be to use the document() function to iterate over all nested maps and then identify the SVG files. This could be done, but I'd avoid it, because this might be a little bit tricky.

But it really depends on what you are trying to achieve.
stefan-jung.org – Your DITA/DITA-OT XML consultant
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Run Xpath with DITA Map Hierarchy Scope from Project View

Post by Radu »

Hi,
Maybe a trick would have been to create a new DITA Map, open it in the Oxygen DITA Maps Manager view, select and copy from the Project view all those 30 maps, paste them in the new DITA Map so that it creates topicrefs to each of them and then you would have an XPath context DITA Map which refers all other 30 maps.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Run Xpath with DITA Map Hierarchy Scope from Project View

Post by Radu »

Another way to go about this:

In the Oxygen Project right click the root and choose "Enable main files support".
Then select all 30 maps in the project, right click and "Add to main files".
Then right click that particular SVG image and choose "Show dependent resources".
Adding all your root maps as "main files" has other benefits as well:

https://www.oxygenxml.com/doc/ug-editor ... files.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
dreifsnider
Posts: 105
Joined: Thu Aug 30, 2018 10:06 pm

Re: Run Xpath with DITA Map Hierarchy Scope from Project View

Post by dreifsnider »

Thanks for the replies Stefan and Radu!

To quickly answer Radu: thanks for the suggestions of nesting the DITA Maps under a single DITA Map as well as using the main files feature of the project. In this situation, the main files feature would not have worked, because our goal was to first find an SVG that is actually referenced in a topic (we have quite a lot of SVGs that are no longer used/referenced in any topics). However, the nesting of the DITA Maps under a single one would've been a great alternative and I'll keep this in mind in the future!

To answer Stefan: our use case is that we publish our DITA documentation to an online portal using a custom implementation of the HTML5 plugin. We made some CSS changes to our site that impacted SVGs, and I wanted to ensure that none of the SVGs that we currently use were negatively affected. However, I wasn't sure which SVGs were being used, because our repositories contain a lot of SVGs that have been archived/deprecated. So I needed to find out which ones are actually in use and then check on our online portal if there were affected by the CSS change. However, I'm sure we'll have more use cases involving SVGs in the future so I'll keep your suggestions in mind. Thank you!

Daniel
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Run Xpath with DITA Map Hierarchy Scope from Project View

Post by Radu »

Hi Daniel,
About this:
However, I wasn't sure which SVGs were being used, because our repositories contain a lot of SVGs that have been archived/deprecated.
If you right click the root of a DITA Map opened in the DITA Maps Manager view we have a "Find Unreferenced Resources" action which should give you all unused image or topic files (which are not referenced directly or indirectly from a DITA Map).
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply