Custom refactoring - creating an output file
Oxygen general issues.
-
- Posts: 6
- Joined: Wed Dec 16, 2015 3:49 pm
Custom refactoring - creating an output file
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.
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.
-
- Posts: 9436
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Custom refactoring - creating an output file
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
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
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 6
- Joined: Wed Dec 16, 2015 3:49 pm
Re: Custom refactoring - creating an output file
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
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
-
- Posts: 9436
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Custom refactoring - creating an output file
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
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
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service