Changing validator user functions file programmatically

For technical support and bug reports for all editions of CSS HTML Validator, including htmlval for Linux and Mac.
User avatar
MikeGale
Rank VI - Professional
Posts: 726
Joined: Mon Dec 13, 2004 1:50 pm
Location: Tannhauser Gate

Changing validator user functions file programmatically

Post by MikeGale »

Hi,

I'm considering automating some work with CSE, using the batch wizard.

Part of it involves customised validator user functions code, for each batch.

I'm not sure how best to achieve this.
  • The user function files are set in a GUI then saved, and I don't see that setting in a veo file, which otherwise seems a good approach.
  • Another approach might be to write an Interop assembly and set it using that. A heavyweight approach, that I'd prefer to avoid.
  • I could edit a functions file programmatically, though that might be clumsy and restrictive, if I'm running a few of these.
  • Consider other architecture for what happens in the functions file.
Have I missed a way to achieve this?
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

Re: Changing validator user functions file programmatically

Post by Albert Wiersch »

Hi Mike,

Are you referring to the user function file for the Batch Wizard? If so, then each target list can have its own user function files. In this case the user function files are saved in each target list... but you probably already know this. :)

But I assume that you want to alter the user function files that are specified in the Validator Engine Options. You are right that they are not included in VEO files. I think I did that to prevent possible problems with sharing settings and paths. How about I add an export option to include the user function files in VEO files? Then you could check that option and export the settings. I think this sounds like the easiest approach and it should not be that difficult to implement.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
User avatar
MikeGale
Rank VI - Professional
Posts: 726
Joined: Mon Dec 13, 2004 1:50 pm
Location: Tannhauser Gate

Re: Changing validator user functions file programmatically

Post by MikeGale »

Yep, I'm thinking of the Validator code.

That export option is an excellent solution. I like that.
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

Re: Changing validator user functions file programmatically

Post by Albert Wiersch »

Great. I'll work on this next week and get back to you.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

Re: Changing validator user functions file programmatically

Post by Albert Wiersch »

Hi Mike,

I've just emailed you a link to a new version to try.

Please check the export option in the Validator Engine Options to export the user functions file(s) (it should default to unchecked). You'll probably want to also make sure that the option to to load the config is checked so you are not prompted for a reload when you import the VEO file and the user functions file(s) change(s).

Please let me know how it works.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial