Clean up .xpr project files

Are you missing a feature? Request it's implementation here.
whyme
Posts: 70
Joined: Fri Mar 08, 2013 8:58 am

Clean up .xpr project files

Post by whyme » Wed Feb 21, 2018 1:53 am

I have been developing a project that is now several years old, and the project .xpr file is now 3.5 MB. Recently I've been getting "Unable to save" messages when I change a transformation scenario for a file, and I'm wondering if the size is a problem (perhaps in tandem with Dropbox syncing). I'm sure there is dead weight in the project file, since there are transformations I set up long ago but point to resources that no longer exist, and did stuff I now can't remember. Or framework extensions that I created but abandoned. Or who knows what.

I dread the thought of starting over from scratch. I dread the thought of carrying on as normal. I dread the thought of analyzing and guessing at what kinds of things I can delete from an .xpr file (indeed, opening it up in oXygen is a chore).

I think it would be great if, under the project menu, I had access to a dialogue that would let me evaluate my project contents, to drop things that are clearly dead, to review things that might be. I imagine this sort of feature would be useful for other purposes, e.g., reminding me of side projects I had been toying with in the past, but had forgotten to resume.

Perhaps this feature already exists? Or are there best practices for project files that would allow me to remedy or avoid this situation?

Radu
Posts: 7019
Joined: Fri Jul 09, 2004 5:18 pm

Re: Clean up .xpr project files

Post by Radu » Wed Feb 21, 2018 10:12 am

Hi,

I'm not sure if the "Unable to save" messages relate to the size of the XPR, most probably they do not. So first you should check if the XPR is in a folder which has write permissions and if it is not marked as read-only in the file system.
You can also try to drag and drop it to the Oxygen main editing area, open it and try to add a space to the end of it and save, just to see if Oxygen can save to it.

In order to reduce the size of the XPR:

1) Open your "Configure Transformation Scenarios" dialog or the "Transformation Scenarios" view and remove all unused transformation scenarios which are saved at project level.
2) Go to the "Document Type Association" page and if the radio buttons at the end of the page signal that it is saved at project level consider switching it to "Global Options" if you do not want to share framework extensions via the project file.
Or remove the framework extensions which you have created and are not used anymore.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

whyme
Posts: 70
Joined: Fri Mar 08, 2013 8:58 am

Re: Clean up .xpr project files

Post by whyme » Wed Feb 21, 2018 8:19 pm

Thanks, Radu this makes sense. I didn't know about getting .xpr files into the editor via dragging.

Now that I'm looking at my .xpr file, I'm wondering if, instead of a new menu option as I had earlier requested, there was a built-in project.sch file in frameworks/oxygen/ that did some basic checking and perhaps Schematron Quick Fixes on any .xpr file in the editor? I'm thinking of very basic stuff, at least to start with, such as doc-available() checks on //field[@name="inputXSLURL"]/string. I realize anyone can do this on their own, but I don't relish the thought of writing routines that convert common editor variables (e.g., ${pdu}), when that might be simply reinventing a wheel you've already created on your end.

Radu
Posts: 7019
Joined: Fri Jul 09, 2004 5:18 pm

Re: Clean up .xpr project files

Post by Radu » Thu Feb 22, 2018 9:23 am

Hi,

I will register an internal issue about your idea of having some kind of Project Cleanup Wizard.
Problem with using plain XSLT is just what you said, editor variables like ${pdu} need to be expanded in order to check for references.
Also I'm not sure if the project size could be attributed only to transformation scenarios, you would need to probably have hundreds of those.
And it's more comfortable (and safer) to remove project-saved transformation scenarios from the "Transformation Scenarios" view than cutting things out directly in the XPR.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply