Running transformation on large set of files

Oxygen general issues.
4everJang
Posts: 22
Joined: Mon Oct 14, 2013 2:12 pm

Running transformation on large set of files

Post by 4everJang »

I need to run (and often re-run) a transformation on a large number of XML files, so I am doing this from the Project view. As the files are located in several subdirectories inside the main folder, I would like to use something like the Find/Replace dialog where I can tell oXygen which types of files to transform. Obviously, the *.dita results of the earlier transforms can be skipped, just like other media files.

When I use the Transform with... command, there is no way I can tell oXygen to only process *.xml files. Apart from using Ant, is there another option to do what I want to do?
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

Re: Running transformation on large set of files

Post by adrian »

Hi,

You can use project filters either in your current project or create a separate project for this specific purpose.
You can apply project filter patterns via menu > Project > Filters.
e.g.
Matching files will be shown: *.xml
"Transform with" from the contextual menu in the Project view will only apply the scenario on the files visible (not filtered) from the project tree.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
4everJang
Posts: 22
Joined: Mon Oct 14, 2013 2:12 pm

Re: Running transformation on large set of files

Post by 4everJang »

Hello Adrian,

Thanks for the info.

It works, but I would have liked a better mechanism for this. The Find/Replace in files command allows setting the filter per action, which is very useful when handling large folders with various types of files. For the transform, it would be very useful to have a similar option. That would remove the need to change the project filter, then run the transforms, then change the project filters again to access the resulting files. I am transforming XML files into DITA and need to repeat the action after each small change to the XSL.

It seems to me that this option - which could be added to the Configure Transformation would not be a huge effort to add as an option and I am sure many developers will thank you for this. It is not always easy and desirable to set up a Document Type Association for this type of action.

Of course I could also create an Ant script to handle this but that is overkill for the simple restriction I would like to put on the transformation mechanism. I just want the transformation to skip the DITA and media files that are found in the same subdirectories.

Kind regards

4everJang
adrian
Posts: 2879
Joined: Tue May 17, 2005 4:01 pm

Re: Running transformation on large set of files

Post by adrian »

Hi,

What I proposed is a solution that is usable with existing Oxygen mechanisms. Something that you can already try now, even if it isn't straightforward. You can use multiple projects so you don't have to set and remove filters repeatedly. Have a separate project already set up with the filters for the type of files you want to transform and switch back and forth.
I have logged a feature request, but that will take some time to get implemented. For future reference it is issue EXM-46632.

Oxygen mostly concentrates on scenario associations rather than ad-hoc transformations (like "Transform with"). "Transform with" is a project action, so it was designed to work on the project file selection, as opposed to "Find/Replace in Files" which basically works on any file set.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
4everJang
Posts: 22
Joined: Mon Oct 14, 2013 2:12 pm

Re: Running transformation on large set of files

Post by 4everJang »

Thanks, Adrian. The bulk of the work is done, so I am OK for now. If I need more switching back and forth I will use your approach of multiple projects looking at the same set of files.

Kind regards from Amsterdam

Jang
Post Reply