Validate on save?

Having trouble installing Oxygen? Got a bug to report? Post it all here.
smaug42
Posts: 44
Joined: Tue May 25, 2004 2:27 pm

Validate on save?

Post by smaug42 »

Is it possible to have Oxygen automatically validate the XML when you save?

What I'd like to do is have Oxygen auto-check the doc when I try to save and warn me if I try to save an invalid doc. Another unnamed editor (I'm no longer using since I'm moving to OxygenXML) would do this and it was a good way to make sure the people editing the XML were creating valid documents before they put them back into CVS.
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi,

Next version of oXygen will have an option to enable save all before validate or transform actions. Currently the Eclipse plugin distribution does a wellformedness check before save.
I will add validate on save feature on our bugzilla.

Happy Holidays!
George
Lars
Posts: 10
Joined: Sat Jan 15, 2005 12:12 am

Post by Lars »

Hello,
I think the "next version" since then was 5.0. I'm now using 5.1 beta, but I can't find an auto-validate-on-save option. Did it make it into this version? I too would appreciate having this feature.

Thanks,
Lars
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi Lars,

Version 5.1 has the save before validate option. Now validate before save seems to me almost the same thing, only the order is different but they do basically the same thing. You get the file saved and checked to be valid in one action.

Best Regards,
George
Lars
Posts: 10
Joined: Sat Jan 15, 2005 12:12 am

Post by Lars »

Can you tell me where to find the save-before-validate option? I have looked in Preferences under Save and other places that looked relevant, but can't find that option.
Or is it only in 5.1, not 5.1 beta?

Anyway, I'm not convinced that save-before-validate really meets the need described here. The idea of validate-on-save is that any modifications you save are guaranteed to be valid (unless you turn off the option or explicitly "save anyway" a document that you are told is invalid). This is not the case with save-before-validate.

A big part of the issue is developer behavior: validate-on-save allows the developer to continue well-established habits (saving changes), and get the extra benefit of being notified when a document is not valid. With save-before-validate, the developer has to learn the habit of validating frequently, and the extra "saving" feature does not add much since he's already in the habit of saving his changes. Moreover, save-before-validate will save invalid documents just as easily as valid ones, so there is no guarantee that saved documents are valid.

Thanks,
Lars
smaug42
Posts: 44
Joined: Tue May 25, 2004 2:27 pm

Post by smaug42 »

You hit on it exactly Lars. The idea is that you cannot save invalid XML without doing an additional action (like clicking an "OK to save anyway" button). A validate-on-save keeps you from putting an invalid document into your project.
Lars
Posts: 10
Joined: Sat Jan 15, 2005 12:12 am

Post by Lars »

Smaug, thanks for the confirmation.

George, never mind my above question about where to find the save-before-validate option -- I found it (in 5.1) under Preferences / Editor / Save / Save all files before transformation or validation.
Post Reply