Author Topic: Turn off auto validation of XML files  (Read 10722 times)

jbhurst

  • Senior Community Member
  • Posts: 405
  • Hero Points: 33
Turn off auto validation of XML files
« on: April 23, 2007, 06:34:36 AM »
Hi,

How do I turn off auto validation of XML files? I have unchecked "Auto validate on open" in the XML Options in File Extension Setup. This appears to have no effect.

When I am working offline or at a customer site with firewall, and I try to open an XML file that references a DTD or schema, I get SlickEdit hanging for a long time (at least a minute) with status message "Connecting to ...", then the "HTTP Load Error" window (with "Connection refused").

As you can imagine, this makes SlickEdit virtually unusable for XML files when there is no open internet connection available.

Regards

John Hurst
Wellington, New Zealand

Zak

  • Community Member
  • Posts: 5
  • Hero Points: 0
Re: Turn off auto validation of XML files
« Reply #1 on: April 24, 2007, 01:10:33 PM »
Hi John,

I, too, was more annoyed than inconvenienced by the inability of disabling the auto validation for the XML file extension.  In my case, I do a lot of macro-driven examination/update of files in a fileman list.  Whenever an XML file was in the list, the resulting validation error dialog would interfere with the macro's behavior.  So, not really depending at all upon the benefits of auto validation, I searched for a way to disable the feature.

I managed to turn off auto validation of the XML file extension by setting it up to refer to another extension, HTML, for which I had previously unchecked "Auto validate on open" giving me the expected behavior (no validation on open).

However, in order to get the "refer to" button for XML to be enabled, I had to first change any file extension that was referring to XML to refer to some other extension.  In my case, I changed all these extensions to refer to HTML instead of XML.  Once the "refer to" button for the XML extension was enabled, I was able to set XML to refer to HTML.  At this point all XML extension files stopped being validated on open.

I'm not really certain of what I've given up in terms of auto-completion, ... etc. by treating all these files as HTML-equivalents.  The main feature of the editor that I've come to depend on is syntax highlighting, and HTML is a reasonable equivalent to XML in this respect.  Someone else, though, may not be willing to sacrifice pure XML extension support in the editor as I have.

jbhurst

  • Senior Community Member
  • Posts: 405
  • Hero Points: 33
Re: Turn off auto validation of XML files
« Reply #2 on: April 24, 2007, 09:57:39 PM »
Thanks for your comment Zak.

@SlickTeam: Any comment on this?

John Hurst
Wellington, New Zealand

Rodney

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 798
  • Hero Points: 54
Re: Turn off auto validation of XML files
« Reply #3 on: April 24, 2007, 10:25:10 PM »
I believe the error you see is a result of us trying to pull down the dtd/schema in order to set up color coding, not for validation.

There is a macro variable, def_xml_no_schema_list, that you can set to a space-separated list of extension on which to bypass color coding set up:

Macro>Set Macro Variable
Variable: def_xml_no_schema_list
Value: .xml

or, from the command line:

set-var def_xml_no_schema_list .xml

IMPORTANT: You must prepend the '.' to the extension (e.g. '.xml' NOT 'xml').

If you want to later apply color coding to the file, you can always right-click in the file window and select "Apply DTD, TLD or Schema Changes".

If you want to later validate the file you either hit the Validate button on the XML toolbar or run xml_validate from the SE command line.

--rodney

jbhurst

  • Senior Community Member
  • Posts: 405
  • Hero Points: 33
Re: Turn off auto validation of XML files
« Reply #4 on: April 24, 2007, 11:07:26 PM »
Thanks Rodney! That's fixed it. This has been annoying me for years. :-) HP++.

John Hurst
Wellington, New Zealand