Author Topic: How do I turn off automatic XML DTD validation?  (Read 13750 times)

jkwuc89

  • Senior Community Member
  • Posts: 199
  • Hero Points: 6
How do I turn off automatic XML DTD validation?
« on: July 20, 2006, 07:22:42 PM »
Every time I load an XML file with a DOCTYPE that references a DTD, SlickEdit automatically tries to validate the XML file against the DTD using HTTP.  Unfortunately, many of the DTD files referenced by these XML files are not available via HTTP and I don't have local copies with which to provide URL mappings.

So, how do I turn off the DTD validate that SlickEdit 11 automatically does?

Matthew

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 990
  • Hero Points: 44
Re: How do I turn off automatic XML DTD validation?
« Reply #1 on: July 20, 2006, 10:06:19 PM »
Go to Tools | Options | File Extension setup. Select xml in the drop-down. At the bottom of the dialog click the Options button. Deselect the Auto Validate on open checkbox.

And if you do want to validate manually, you can use the commands on the XML toolbar, or run xml-validate on the command line.

jkwuc89

  • Senior Community Member
  • Posts: 199
  • Hero Points: 6
Re: How do I turn off automatic XML DTD validation?
« Reply #2 on: August 22, 2006, 11:21:20 AM »
Turning off Auto Validate on open for the XML file extension did the trick for files with a .xml extension.  However, for file extensions that refer to the .xml file extension to get their options, auto validation on open still occurs even though the Auto Validate option is turned off.

To recreate:
1.  Copy a .xml file to a new extension (like .mxl)
2.  Make sure that Auto Validate for .xml files is turned off
3.  Open File Extension Setup... and then, click on New
4.  Enter .xml for the extension and choose .xml next to Refer to->
5.  Open a .mxl file that refers to a DTD that is not available.  SlickEdit will attempt to auto validate it.

Matthew

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 990
  • Hero Points: 44
Re: How do I turn off automatic XML DTD validation?
« Reply #3 on: August 22, 2006, 01:15:32 PM »
Hmm. That's not the behavior I'm seeing. I have several extensions that I use that refer to xml (like .wxs, .wxl, .build, et ales), and turning off the xml validation correctly affects all those affiliated extensions. I've tested this with both 10.0.3 and 11.0.1. Are you using a version prior to those?

SlickEdit Support

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 384
  • Hero Points: 29
Re: How do I turn off automatic XML DTD validation?
« Reply #4 on: August 22, 2006, 04:41:12 PM »
To prevent SlickEdit from accessing the internet to validate and get color coding information from DTDs completely you will need to edit the macro variable 'def_xml_no_schema_list'.   To set this variable go to Macro > Set Macro Variable > enter def_xml_no_schema_list as the variable name and you will then need to set its value.  Set its value to a list of space delimited extensions that you want to excluded for actual schema validation.  For example: .xml .xsl .xsd  This will prevent SlickEdit from attempting to connect to the internet for these extensions.  Hope this helps!

jkwuc89

  • Senior Community Member
  • Posts: 199
  • Hero Points: 6
Re: How do I turn off automatic XML DTD validation?
« Reply #5 on: August 23, 2006, 11:41:20 AM »
I am using SlickEdit 11.01 on Windows XP.
The .mxl file I am opening refers to two namespaces in the root tag.  It does not refer to a DTD.
The .mxl file extension is set up to refer to the .xml file extension and the .xml file extension has auto validate on open turned off.
Each time I attempt to open the .mxl file, it performs an HTTP connect in an attempt to validate the file.

Setting the def_xml_no_schema_list macro variable as described in the last reply does prevent this behavior.