Access Violation Error with Old CFG File

For technical support for all editions of CSS HTML Validator. Includes bug reports.
Jerry K
Rank I - Novice
Rank I - Novice
Posts: 13
Joined: Tue Apr 19, 2016 9:51 am

Access Violation Error with Old CFG File

Post by Jerry K » Tue Apr 19, 2016 10:50 am

I just upgraded my license and installed the latest HTML Validator (v16.03). Unfortunately my (very old) CFG file does not load, throwing an Access Violation error...
error.png
error.png (18.35 KiB) Viewed 4985 times
Is there a way to convert this old CFG file, or am I stuck having to recreate a new one?

Thanks,

Jerry.

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3412
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Access Violation Error with Old CFG File

Post by Albert Wiersch » Tue Apr 19, 2016 11:11 am

Hi Jerry,

Sorry, it shouldn't crash like that. Can you email me your config file (to support at htmlvalidator dot com) so I can try reproducing the problem? If I can fix this then your old config file will probably work.

Also, it's not recommended to use old config files since you will miss out on a lot of the new checks and updated support for new HTML tags and attributes. I don't know how heavily modified your config file is, but you might want to see if you can convert it to using a separate user functions file where you can separate all your custom functionality into a separate file from the primary config file.
Image
Albert Wiersch

Jerry K
Rank I - Novice
Rank I - Novice
Posts: 13
Joined: Tue Apr 19, 2016 9:51 am

Re: Access Violation Error with Old CFG File

Post by Jerry K » Tue Apr 19, 2016 12:08 pm

Thank you Albert:

I sent the file, and if you are able to recover it for me (it is indeed heavily modified), I will attempt to convert it to a user functions file at some later date. First, I'll need to acquaint myself with user functions files.

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3412
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Access Violation Error with Old CFG File

Post by Albert Wiersch » Tue Apr 19, 2016 12:19 pm

Thank you. I received it and found the problem already. I noticed some possible other issues so I am going to work on that and get back to you. Boy, that is indeed an OLD config file. :D
Image
Albert Wiersch

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3412
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Access Violation Error with Old CFG File

Post by Albert Wiersch » Tue Apr 19, 2016 2:56 pm

Hi Jerry,

Please re-download CSE HTML Validator Pro from here:
https://www.htmlvalidator.com/download/registered.php

You should get v16.0305 (even though it may say that you are downloading an earlier version) which should fix the crash problem. Please let me know how it works with your old config file.
Image
Albert Wiersch

Jerry K
Rank I - Novice
Rank I - Novice
Posts: 13
Joined: Tue Apr 19, 2016 9:51 am

Re: Access Violation Error with Old CFG File

Post by Jerry K » Tue Apr 19, 2016 4:02 pm

Hi Albert:

I was able to get the CFG file open and run it with this new update. There are some errors I'm not used to seeing, but that may be a fault on my side, not yours. Thanks very much for the speedy response time!

Best,

Jerry.

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3412
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Access Violation Error with Old CFG File

Post by Albert Wiersch » Tue Apr 19, 2016 4:24 pm

You're welcome!

I did notice one issue with "getStringStartindex()":
The start tag name program for the element "IMG (0003)" generated an error while executing: 99121301: call to undefined function 'getStringStartindex()'

In recent versions of CSE HTML Validator functions (as well as variable names) are case sensitive so getStringStartindex() this should be changed to getStringStartIndex() or stripos(). stripos() is recommended but only works in v14.00+.

Please let me know if you have any more questions.
Image
Albert Wiersch

Jerry K
Rank I - Novice
Rank I - Novice
Posts: 13
Joined: Tue Apr 19, 2016 9:51 am

Re: Access Violation Error with Old CFG File

Post by Jerry K » Tue May 24, 2016 8:37 am

Hi Albert:

I finally have time to circle back around to "User Function Files". It sounds like a smart idea to avoid the habit of using custom config files, but the one we currently have is heavily edited (many elements are disallowed, many attributes are customized, etc.). Can you suggest a good starting point for creating the User Functions File or is the in-app Help the best place to learn how to do this?

Thanks!

Jerry.

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3412
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Access Violation Error with Old CFG File

Post by Albert Wiersch » Tue May 24, 2016 9:13 am

Hi Jerry,

A good starting point would be this documentation page (and its subpages):
https://www.htmlvalidator.com/v160/docs ... nguage.htm

This "chapter" lists the validator engine event functions that are available:
https://www.htmlvalidator.com/v160/docs ... idator.htm

On some of the function documentation pages it will give examples that use the function to give you a better idea of how to use it.

Here's a useful function that you'll probably use (with several examples):
https://www.htmlvalidator.com/v160/docs ... agname.htm

If you have any questions then you can post here what you want to do (in detail) and I will see if I can write the proper user function for you or point you to it. For example, generating an error messages when certain elements are used should be easy with the onStartTag_(tagname) function.

A user function like this would generate an error every time the "foo" element is used:

Code: Select all

function onStartTag_foo() {
 Message(1,MSG_ERROR,"Don't use the foo element! It's bad.");
}
Image
Albert Wiersch

Jerry K
Rank I - Novice
Rank I - Novice
Posts: 13
Joined: Tue Apr 19, 2016 9:51 am

Re: Access Violation Error with Old CFG File

Post by Jerry K » Tue May 24, 2016 11:05 am

Hi Albert:

I'm clearly missing a step, as I'm not getting any message from my User Functions file. I made sure to add the file name to the User functions field under "Validator Engine > Config File".

My HTML file is virtually empty:

Code: Select all

<html>
<h5>Should throw an error message</h5>
</html>
My User Function file has just two functions:

Code: Select all

function onStartValidation() {
 Message(true, MSG_COMMENT, "User functions loaded. Starting the validation!");
}
function onStartTag_h5() {
 Message(1,MSG_ERROR,"Don't use the H5 element! It's bad.");
}
But none of my messages show up:
Validator message export for "C:\Projects\empty.html":
Generated by CSE HTML Validator Professional v16.03 (https://www.htmlvalidator.com/)

1. Warning in line 1 at character 1: [24] A document type declaration should appear as the first line (line 1) of every HTML document. For example, for HTML5 documents use <!DOCTYPE html>. For HTML 4.01 Strict documents use <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">. For HTML 4.01 Transitional documents, use <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">. Although HTML recommendations generally require this line, most browsers probably ignore it. If you're using HTML Validator's integrated editor, then this can be added from the 'Tags' menu or from the HTML Inserter.

2. Warning in line 1 at character 1: (Grouped->General Compatibility) Not using a DOCTYPE will likely trigger quirks mode in browsers. If possible, quirks mode should be avoided in favor of standards mode. Visit http://en.wikipedia.org/wiki/Quirks_mode for more information about quirks mode. Note that the recommended DOCTYPE to use now is HTML5, which is simply <!DOCTYPE html>.

3. Warning in line 1 at character 2: The natural primary language is not specified. It is highly recommended that the "lang" and/or "xml:lang" (for XHTML) attributes be used with the "html" element to specify the primary language. For example, add the attribute lang="en" for English or lang="fr" for French. Specifying the language assists braille translation software, speech synthesizers, translation software, and has other benefits.

4. Warning in line 2 at character 2: [32] A "body" section has been started but a "head" section did not appear before this "body" section. A "head" section should exist before the "body" section. HTML 4.01 and XHTML require that each document have a "head" section.

5. Message in line 2 at character 2: (Grouped->Omitted Start Tags) [132] Assuming an omitted "body" start tag before this start tag. For better structure, it is recommended to explicitly start all "body" elements with an explicit start tag. The omitted "body" start tag should probably be placed right before this start tag.

6. Warning in line 3 at character 3: [32] This document does not have a "head" section with a title. HTML 4.01 and XHTML require that each document have a "head" section with a "title" element.

7. Message in line 3 at character 3: (Grouped->Omitted End Tags) [128] Assuming an omitted "body" end tag before this end tag. The "body" start tag (in line 2 [an implied tag]) does not have an end tag or the end tag (</body>) is in the wrong place. For better structure, it is recommended to explicitly end all "body" elements with an end tag. The omitted "</body>" end tag should probably be placed right before this end tag.

8. Comment: (Accessibility->Section 508 Accessibility Standards) [73] Section 508 accessibility checking is off.

9. Comment: (Accessibility->WCAG 1.0) [73] WCAG 1.0 accessibility checking is off.

10. Comment: (Accessibility->WCAG 2.0) [73] WCAG 2.0 accessibility checking is off.

11. Comment: (Accessibility->Accessibility Tips) Accessibility checking is off. This program can help you make your web pages more accessible. An accessible page is one that more individuals can use, such as individuals who are blind or deaf. It can also increase the usefulness of your web page for individuals who browse the web using slower devices like older computers or wireless devices like mobile phones and PDAs. An accessible web site makes good business sense (and possibly good legal sense as well) and may even improve search engine rankings. You can enable or disable accessibility checking in the Validator Engine Options.

12. Comment: (Grouped->Search Engine) Keyword density: error (1x - 20.0%), message (1x - 20.0%), Should (1x - 20.0%), throw (1x - 20.0%). Remember: Don't write SEO optimized content. Write for people, which is what search engines want. Complete list. 1 word excluded.

13. Comment: HTML document detected.

14. Comment: (Grouped->Mobile) [133] Mobility Tip #14 - Avoid plugin content like Flash, Silverlight, and Java content that is not widely supported. Instead, make use of native web technologies (like the "video" and "audio" elements in HTML5 which allow you to provide multiple content formats). Ensure that any content that is not widely supported is not essential for the main function or purpose of the page, and/or provide a redirection mechanism to an alternate equivalent site that uses widely supported content. Visit https://developers.google.com/speed/doc ... oidPlugins for more information.

15. Comment: (Grouped->Search Engine) No "h1" or "h2" heading element was found. Using these heading elments (especially "h1" and preferably with your best keywords) to describe sub-topics of a page may improve search engine rankings. If "h1" text is too large then you can reduce its size with CSS.

16. Comment: (Grouped->Search Engine) No italicizing, emphasizing, bolding, or strong tags were used. Emphasizing or italicizing keywords (with the "em" element) may improve rankings. Similarly, using strong text or bolding keywords (with the "strong" element) may also improve rankings.

17. Comment: (Grouped->Search Engine) [113] Random Search Engine Tip #18 - USE YOUR SERVER LOG. Look at your site's referral logs to see what keywords people are using to find your site. Use this information to improve your site. For example, you may want to add content related to keywords that have been overlooked.

18. Comment: (Grouped->Tips) [10] CSE HTML Validator (standard or higher) allows you to disable certain messages (like this example message) and groups of related messages by disabling flags. For example, the [10] at the beginning of this message indicates that this message can be disabled by disabling validator flag 10. If you are using HTML Validator's integrated editor, then you can use your mouse on this message to open the context menu (usually done by right-clicking the mouse on this message) and selecting 'Message Options->Disable Flag 10' to disable this message. For more information about disabling messages, see the 'Disabling Validator Messages' topic in the documentation.

19. Comment: (Grouped->Tips) CSE HTML Validator (standard or higher) allows you to disable many messages on an individual basis without using flags. For instance, you can disable this message by using HTML Validator's integrated editor to open the context menu for this message (usually done by right-clicking the mouse on this message) and selecting 'Message Options->Disable using Message ID' or 'Message Options->Disable using Exact Text Match' to disable this message. For more information about disabling messages, see the 'Disabling Validator Messages' topic in the documentation.

20. Comment: 0.00s, 0 errors, 5 warnings, 2 messages, 13 validator comments, 3 lines, 3 elements (with 3 end tags), 0 document comments, 0 character references, 5 words spell checked (0 in comments).
What am I forgetting, or getting wrong?

Thanks!

Jerry.

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3412
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Access Violation Error with Old CFG File

Post by Albert Wiersch » Tue May 24, 2016 11:40 am

Jerry K wrote:Hi Albert:

I'm clearly missing a step, as I'm not getting any message from my User Functions file. I made sure to add the file name to the User functions field under "Validator Engine > Config File".
Hello,

Did you reload the configuration or exit and restart CSE HTML Validator? You'll need to do that every time the user functions file changes so that the changes will take effect.

The fastest way to do this is probably just to press Shift+Ctrl+Alt+L in the editor and then click 'Open'.
Image
Albert Wiersch

Jerry K
Rank I - Novice
Rank I - Novice
Posts: 13
Joined: Tue Apr 19, 2016 9:51 am

Re: Access Violation Error with Old CFG File

Post by Jerry K » Tue May 24, 2016 11:47 am

Hi Albert:

Yes, I tried both reloading the config file and restarting the validator. Anything else I can try?

Jerry.

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3412
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Access Violation Error with Old CFG File

Post by Albert Wiersch » Tue May 24, 2016 12:07 pm

That's strange. I didn't have any issue getting it to work after creating a new user functions file, copying your user functions into it and specifying it in the Validator Engine Options.

Did you specify the full path of your user functions file in the Validator Engine Options?

Make sure your user functions file is saved (and that you didn't leave it unsaved in the editor so the file is empty). Make sure it points to the right file.

Make sure you reload the config or restart CSE HTML Validator.

If the above doesn't help, then can you send me a screenshot of the Validator Engine Options page where you specified your user functions file?
Image
Albert Wiersch

Jerry K
Rank I - Novice
Rank I - Novice
Posts: 13
Joined: Tue Apr 19, 2016 9:51 am

Re: Access Violation Error with Old CFG File

Post by Jerry K » Tue May 24, 2016 12:23 pm

Just in case, I tried copying the functions file to the root folder on my C: drive. Attached is the screen shot and my functions file.
screenshot.png
Screen shot of validation settings.
screenshot.png (237.79 KiB) Viewed 4856 times

Thanks,

Jerry.
Attachments
sample.zip
ZIP containing my test functions file.
(319 Bytes) Downloaded 112 times

User avatar
Albert Wiersch
Site Admin
Site Admin
Posts: 3412
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Re: Access Violation Error with Old CFG File

Post by Albert Wiersch » Tue May 24, 2016 12:31 pm

HI Jerry, thank you. I think I know what the problem is. Please save your user functions file using UTF-8 and then reload the config and try again.
Image
Albert Wiersch

Post Reply