Define input file mask for transformation senario

Are you missing a feature? Request it's implementation here.
daliboris
Posts: 18
Joined: Thu Feb 11, 2010 5:00 pm

Define input file mask for transformation senario

Post by daliboris » Thu Feb 14, 2013 1:12 am

When transforming folder with transformation scenario, it would be useful to have something like "file mask" or "file pattern" defined in scenario. For example, if there are multiple files in the same directory (e.g. XML and HTML files), I want transform only XML files (ie. files with ".xml" extenstion). I didn't find how to achieve this with transformation scenario.

I tried use "XML URL: ${cfdu}/*.xml", but this gives me an error.

Combination of parameters "XML URL: ${currentFileURL}" and (new) "XML File Pattern: *.xml" would useful.

I see only one possible problem: what if there is current file opened in editor and this file does not match the pattern. Should be transformed, or not? I think it shouldn't.

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

Re: Define input file mask for transformation senario

Post by adrian » Thu Feb 14, 2013 7:09 pm

Hello,

Please note that a transformation scenario can only be configured to process a single file, so you cannot specify a file filter pattern or mask. However, a scenario that has XML URL: ${currentFileURL} can be applied to a selection of files and directories from the Project view (in turn for each file).

Currently it is not possible to filter the file extension in a scenario, but there are a few possible workarounds:
  • select in the project view only the files that you want involved (instead of an entire directory with mixed files) and then associate the scenario with that selection (right click on the selection from the Project view and from the contextual menu choose Transform > Configure Transformation Scenario(s).)
  • create a logical folder in the project (right click on the root of the project and from the contextual menu choose New > Logical Folder) and link there only the files you want to transform and associate the scenario with that logical folder (either add the files manually or drag and drop them). All the files from that logical folder will also be associated when you associate the logical folder.
  • hide the files that you don't want involved in the transformation. Go to main menu > Project > Filters and in the field Matching files will be hidden type: *.html The transformation on a folder will only by applied to the the files visible in the Project view.
We will consider adding support for such a use case in a future version of Oxygen. I've submitted a feature request for this on our issue tracking tool.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

Post Reply