Skip to content

Commit 753dcea

Browse files
committed
Disable XSD validation when xsi:schemaLocation doesn't declare the
namespace for the document element root. See #951 Signed-off-by: azerr <azerr@redhat.com>
1 parent 86e2f0b commit 753dcea

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

docs/Validation.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,3 +417,7 @@ If `xml.validation.resolveExternalEntities` is set to `true` (default is `false`
417417
Demonstration of the different behaviour:
418418

419419
![When using the default settings, an external entity that has an XML element as its content will not produce a validation error when nested in an element that expects character content. If `xml.validation.resolveExternalEntities` is enabled, then an error will be produced](./images/Validation/ExternalEntityResolvingDemonstration.gif)
420+
421+
## xml.validation.schema.enabled
422+
423+
TODO

package.json

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,20 @@
307307
"markdownDescription": "Enable/disable all validation. Default is `true`.",
308308
"scope": "window"
309309
},
310-
"xml.validation.schema": {
311-
"type": "boolean",
312-
"default": true,
313-
"markdownDescription": "Enable/disable schema based validation. Default is `true`. Ignored if `#xml.validation.enabled#` is set to `false`",
310+
"xml.validation.schema.enabled": {
311+
"type": "string",
312+
"default": "always",
313+
"enum": [
314+
"always",
315+
"never",
316+
"onValidSchema"
317+
],
318+
"markdownEnumDescriptions": [
319+
"Enable schema based validation.",
320+
"Disable schema based validation.",
321+
"Enable schema based validation only when the declared xsi:schemaLocation hint is valid for the root element."
322+
],
323+
"markdownDescription": "Enable/disable schema based validation. Default is `always`. Ignored if `#xml.validation.enabled#` is set to `false`",
314324
"scope": "window"
315325
},
316326
"xml.validation.disallowDocTypeDecl": {

0 commit comments

Comments
 (0)