Custom refactoring - creating an output file

<oXygen/> general issues.
proxx
Posts: 6

Custom refactoring - creating an output file

Mon Mar 13, 2017 2:12 pm

Is it possible to use XML Refactoring Tool to run a XSL script that creates a new output file instead of refactoring files in the ditamap hierarchy?
I know that this is not a real purpose of the Refactoring Tool, but it would be a useful addition.

I would like to iterate over files in the ditamap heirarchy and generate an output file based on information from files.
Radu
Posts: 5757

Re: Custom refactoring - creating an output file

Mon Mar 13, 2017 2:21 pm

Hi,

You can use xsl:result-document in the XSLT to write to a file. But the XSLT refactoring is applied individually on each topic so you cannot collect information from all files and write that to a single file.
To do what you want maybe you can write an XSLT which takes the main DITA Map as input, resolves the topicrefs recursively using the XSLT "document" function, loads each topic and creates a statistic at the end. Something similar to what out DITA Metrics report project does:

https://github.com/oxygenxml/dita-metrics-report

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

Re: Custom refactoring - creating an output file

Mon Mar 13, 2017 3:01 pm

Hi Radu,

Thanks for your advice.
Yes, iterating using document() or doc() functions was my initial approach, but it seems pretty cumbersome to implement with XSL. Especially that topics can live on different levels in the document tree. That's why I thought about utilizing Oxygen's search engine over ditamap hierarchy.
I will check the dita-metrics project though.

Another XML Refactoring Tool advantage is that it is easy to access and use for everyone. It would be less confusing for some people to run a script from there, instead of from XSLT tab.
Is there any other mechanism in Oxygen to share XSL scripts similarly to what XML Refactoring Tool offers?

Take care,
Wojtek
Radu
Posts: 5757

Re: Custom refactoring - creating an output file

Mon Mar 13, 2017 3:39 pm

Hi Wojtek,

You can create transformation scenarios and share them with your team mates (Options menu->Export global transformation scenarios) along with the XSLTs.
Or create an Oxygen project which contains the XSLTs + transformation scenarios saved at project level.

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

Return to “Other Issues”

Who is online

Users browsing this forum: No registered users and 2 guests