Using Oxygen option settings during a transformation

Here should go questions about transforming XML with XSLT and FOP.
mlcook
Posts: 67
Joined: Thu Jan 24, 2008 4:52 pm

Using Oxygen option settings during a transformation

Post by mlcook »

I'm looking for a way to do some Oxygen configuration checking during a transformation.

We have parallel XML projects with very similar sets of schemas and transformations.

When switching to a different project, a user may not always be aware of the correct transformation scenario to use, and which XSL URL is defined in that scenario.

I noticed that there is an XML file (oxyOptionsSa10.3.xml) containing some Oxygen settings for user-defined scenarios.

What I would like to do, I think, is compare some actual transformation scenario values from the <scenario> element against the transformation that should be used for the given project.

In particular, I'd like to compare the XSL URL path against the current XML file being transformed. If they are not in the same hierarchy, our user is probably using the wrong, or outdated, scenario.

Is this possible with Oxygen 10.3?

If so, how do I get access to the Oxygen scenario settings?

If not, it would seem to me to be a useful possibility.

Thanks, Mike
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: Using Oxygen option settings during a transformation

Post by adrian »

Hello,

If you have several projects that have different/distinct sets of transformation scenarios then you should keep the corresponding scenarios in the corresponding project. You can do this in the Configure Transformation Scenario dialog(Document -> Transformation -> Configure Transformation Scenario).
Switch to the Project Scenarios option and the global scenarios(kept in the global options file: oxyOptionsSa10.3.xml) will be copied to the project file(.XPR). All the created/adjusted scenarios will then be saved in the project file(.XPR) instead of the global options file.
The same can be done for preferences(Options -> Preferences). Some of the preferences can be kept in the project(Project Options).


By what means did you intend to compare scenario URLs? Are you using the Author SDK/Plugins API for Oxygen?

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
mlcook
Posts: 67
Joined: Thu Jan 24, 2008 4:52 pm

Re: Using Oxygen option settings during a transformation

Post by mlcook »

Thanks Adrian.

We have not been using "projects" in the Oxygen sense. All our source is configuration managed, and until now we've just been opening files and using transformation scenarios local to each Oxygen installation.

This brings up more questions:
1. Can the .xpr file be saved anywhere, or does it need to be put in the "Oxygen XML Editor 10.3" folder hierarchy, for example?

2. Where is the .xpr file location specified so that Oxygen knows where to get the information?

3. Is it possible to have personal "Global" scenarios, and team "Project" scenarios at the same time, without having them intermixed when switching back-and-forth? I would like to have scenarios not avaiable to the team as a whole.

4. We've been using absolute paths to the XSL URL for a scenario. That absolute path is different on various team member's PCs. But, depending on where a file is in the directory hierarchy, the relative path to the transformations will change. The absolute path to the transformations is different on different PCs because of some user choice in where to put our XML source files. Can the XSL URL for a transformation scenario be located based on some relative path from a preset location that is different for the different PCs?

5. If we also store some preferences in the project .xpr file, are those automatically loaded with the project? (I assume so.) Do they override the global preferences? I'm thinking that certain formatting options, etc., would be useful for uniformity among developers.

6. Finally, for now, I was going to compare URLs as strings or portions of strings. But the project .xpr file might be a better way to go.

Thanks again for your reply,
Mike
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Using Oxygen option settings during a transformation

Post by sorin_ristache »

mlcook wrote:1. Can the .xpr file be saved anywhere, or does it need to be put in the "Oxygen XML Editor 10.3" folder hierarchy, for example?
The .xpr file (Oxygen project file) is a XML file that can be stored anywhere. You open it in the Project view from menu Project -> Open Project or from the toolbar of the Project view.
mlcook wrote:2. Where is the .xpr file location specified so that Oxygen knows where to get the information?
Just open one .xpr file in the Project view as I specified. You can switch between projects from the history of last opened projects that is available on the toolbar of the Project view and also from menu Project -> Reopen Project.
mlcook wrote:3. Is it possible to have personal "Global" scenarios, and team "Project" scenarios at the same time, without having them intermixed when switching back-and-forth? I would like to have scenarios not avaiable to the team as a whole.
Yes, it is possible. When you have a project file opened in the Project view and that project contains transformation scenarios (saved in the .xpr file that is current in the Project view) Oxygen will display in the dialog box of transformation scenarios only the ones from the current project. When you switch to other project only the scenarios from the new project will be used. If the project does not contain project level scenarios the dialog box of transformation scenarios will display only the global scenarios from the user preferences (the file oxyOptionsSa10.3.xml in your case but Oxygen will manage that, you don't (and should not) work directly with this file).

When you switch from project scenarios to global ones in the dialog box of scenarios the project scenarios will be cleared from the project file (a confirmation message will inform you about it) and the global scenarios will be available again in the scenario dialog box.
mlcook wrote:4. We've been using absolute paths to the XSL URL for a scenario. That absolute path is different on various team member's PCs. But, depending on where a file is in the directory hierarchy, the relative path to the transformations will change. The absolute path to the transformations is different on different PCs because of some user choice in where to put our XML source files. Can the XSL URL for a transformation scenario be located based on some relative path from a preset location that is different for the different PCs?
Use one of the predefined editor variables like ${pdu} (project directory as a URL) in the XML URL text box. The path of the XML source file can be relative to the location of the .xpr file, for example: ${pdu}/subfolder/source.xml.

mlcook wrote:5. If we also store some preferences in the project .xpr file, are those automatically loaded with the project? (I assume so.)
Yes.
mlcook wrote:Do they override the global preferences? I'm thinking that certain formatting options, etc., would be useful for uniformity among developers.
Yes, exactly.
mlcook wrote:6. Finally, for now, I was going to compare URLs as strings or portions of strings. But the project .xpr file might be a better way to go.
Just give it a try and let us know if there are problems.


Regards,
Sorin
Post Reply