Transform same file differently from different logical folders

Having trouble installing Oxygen? Got a bug to report? Post it all here.
riks
Posts: 6
Joined: Fri Aug 25, 2023 4:50 pm

Transform same file differently from different logical folders

Post by riks »

I would like to transform the same file in 2 different ways, at different times.
So I created 2 logical folders and attempted to set different transformation scenarios for the same file, in each folder.
But when I edit the scenario in one folder it seems to affect the other. Is that expected behaviour?
I expected that the scenario would be folder specific, not file specific.
is it possible to achieve what I want - run different transforms at different times, without having to re-select the scenarios each time?
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: Transform same file differently from different logical folders

Post by chrispitude »

Hi riks,

By "logical folder," are you referring to logical folders in Main Files?

In Main Files, files in logical folders are stored inside the Oxygen .xpr file as follows:

Code: Select all

<projectTree name="OPENME1.xpr">
    <folder masterFiles="true" name="Main Files">
        <folder name="logical-dir1">
            <file name="topic.dita"/>
        </folder>
        <folder name="logical-dir2">
            <file name="topic.dita"/>
        </folder>
    </folder>
    <folder path="."/>
</projectTree>
Note that the file references in each logical folder are still to the same physical file. So I think the behavior you describe is expected.
riks
Posts: 6
Joined: Fri Aug 25, 2023 4:50 pm

Re: Transform same file differently from different logical folders

Post by riks »

I think this is the same but I am not using a special folder called "Main Files". That seems to be a logical folder too, but they can be called anything.
I can see the same file is in two folders in your example, but that is seems just to be how it knows what files are in the folder. The list of transforms could be stored at folder level just as easily as at file level. But that is what I am asking.
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: Transform same file differently from different logical folders

Post by chrispitude »

Hi riks,

Ahh okay, so you are creating logical folders in the root project level. Now I understand that part.

How are you running the transformations? Are you right-clicking the file entry inside the logical folder, then using the Transform > ... submenu?
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Transform same file differently from different logical folders

Post by Radu »

Hi,
A transformation scenario is associated to a file's URL which does not change if the file is referenced in any place in the project.
You can define multiple transformation scenarios but no matter from what place in the Oxygen Project you open a file, Oxygen will present for it the same set of transformation scenarios which are directly associated with it.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
riks
Posts: 6
Joined: Fri Aug 25, 2023 4:50 pm

Re: Transform same file differently from different logical folders

Post by riks »

thanks both
@chrispitude, yes that is how I am running the transforms.
@radu, so there is no way to achieve what I need? The only solution I can think of is to have two different projects (XPR files). And that is complicated by the fact that you cannot, afaik, open two instances of Oxygen at once.
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Transform same file differently from different logical folders

Post by Radu »

Hi,
How about if you create multiple transformation scenarios at Project level and use the Oxygen "Transformation Scenarios" view to double click either one scenario or another depending on your needs?
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
riks
Posts: 6
Joined: Fri Aug 25, 2023 4:50 pm

Re: Transform same file differently from different logical folders

Post by riks »

thanks Radu
>How about if you create multiple transformation scenarios at Project level
I already do this

>and use the Oxygen "Transformation Scenarios" view to double click either one scenario or another depending on your needs?
I can do that, but that is what I want to avoid. I assume you mean to re-configure the scenario, every time I want to run them?
On one folder I want to run transform scenario A+B and on the other, transform C. I can do as you suggest and select A and B, some of the time and C the rest of the time, but it is not convenient to keep doing that every time I want to transform. A and B are very quick and C takes a long time (it is all working on many xml files). So I want to run A and B often (e.g. every 5 minutes) and C once in a while (e.g. once per hour). Having to re-configure it and put it back again is not the best solution.
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Transform same file differently from different logical folders

Post by Radu »

Hi,
What kind of transformation scenarios are you running? Are they XML with XSLT?
I do not understand what you mean by "re-configure the scenario", you do not need to edit the transformation scenario and change it, just run it.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: Transform same file differently from different logical folders

Post by chrispitude »

Hi Riks,

It sounds like your real goal is a way to quickly run transformation A+B sometimes, and transformation C other times, all in the Project view, without having to change or select the associated transformations for those files each time. And, it sounds like the multiple-logical-folders question was an idea you had to try to achieve this, but it was not the end goal.

Did I understand correctly?
riks
Posts: 6
Joined: Fri Aug 25, 2023 4:50 pm

Re: Transform same file differently from different logical folders

Post by riks »

Thanks guys

@Radu, yes XSLT transformed with XML.

I ideally want: to select the folder, hit the transform button. Then at other times, select the other folder and hit the transform button.

I ideally don't want to: select the folder, use the right click, go to Transform menu, then Transform With, then find the right 2 out of about 20 possible scenarios, select each one, and then use Apply Selected Scenarios. Then repeat all that for the other selection of transforms. That all takes longer and involves thinking.

The other thing I could do is edit the selected scenarios, using "Configure Transformation Scenario(s)" (what I meant by "re-configure"), so that the selection of transforms stays, then run that over and over (a slight efficiency, assuming I can remember which way around it is currently configured), but then have to set it back to the other configuration before doing the other thing.

@chrispitude, yes that is pretty much it.
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Transform same file differently from different logical folders

Post by Radu »

Hi,
I ideally want: to select the folder, hit the transform button. Then at other times, select the other folder and hit the transform button.
I'm afraid I do not have a solution to make this work for you.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

Re: Transform same file differently from different logical folders

Post by chrispitude »

Hi riks,

Are these DITA files that you are transforming to publish their content? If so, you could probably use DITA-OT project files to get almost exactly what you want. (If they are non-DITA XML files, then that wouldn't work for you.)
riks
Posts: 6
Joined: Fri Aug 25, 2023 4:50 pm

Re: Transform same file differently from different logical folders

Post by riks »

no not DITA I am afraid
Post Reply