You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,6 +84,7 @@ The following settings are supported:
84
84
*[`xml.codeLens.enabled`](https://github.com/redhat-developer/vscode-xml/blob/master/docs/CodeLens.md): Enable/disable XML CodeLens. Default is `false`.
85
85
*[`xml.preferences.showSchemaDocumentationType`](https://github.com/redhat-developer/vscode-xml/blob/master/docs/Preferences.md#documentation-type): Specifies the source of the XML schema documentation displayed on hover and completion. Default is `all`.
86
86
*[`xml.validation.enabled`](https://github.com/redhat-developer/vscode-xml/blob/master/docs/Validation.md): Enable/disable all validation. Default is `true`.
87
+
*[`xml.validation.namespaces.enabled`](https://github.com/redhat-developer/vscode-xml/blob/master/docs/Validation.md#xmlvalidationsnamespacesenabled): Enable/disable namespaces validation. Default is `always`. Ignored if [`xml.validation.enabled`](https://github.com/redhat-developer/vscode-xml/blob/master/docs/Validation.md) is set to `false`.
87
88
*[`xml.validation.schema.enabled`](https://github.com/redhat-developer/vscode-xml/blob/master/docs/Validation.md#xmlvalidationschemaenabled): Enable/disable schema based validation. Default is `always`. Ignored if [`xml.validation.enabled`](https://github.com/redhat-developer/vscode-xml/blob/master/docs/Validation.md) is set to `false`.
88
89
*[`xml.validation.disallowDocTypeDecl`](https://github.com/redhat-developer/vscode-xml/blob/master/docs/Validation.md#disallow-doc-type-declarations): Enable/disable if a fatal error is thrown if the incoming document contains a DOCTYPE declaration. Default is `false`.
89
90
*[`xml.validation.resolveExternalEntities`](https://github.com/redhat-developer/vscode-xml/blob/master/docs/Validation.md#resolve-external-entities): Enable/disable resolve of external entities. Default is `false`.
Copy file name to clipboardExpand all lines: docs/Validation.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -420,6 +420,36 @@ Demonstration of the different behaviour:
420
420
421
421
## xml.validation.schema.enabled
422
422
423
+
The `xml.validation.namespaces.enabled` gives the capability to enable / disable the namespaces (prefix) validation. It can be configured with 3 values:
424
+
425
+
*`always`: enable schema based validation.
426
+
*`never`: disable schema based validation.
427
+
*`onNamespaceEncountered`: enable namespaces validation only when the root element declares an xmlns namespace.
428
+
429
+
To understand the `onNamespaceEncountered` settings value, lets go through an example:
430
+
431
+
Create the XML `foo.xml` file:
432
+
433
+
```xml
434
+
<foo>
435
+
<prefix:bar />
436
+
</foo>
437
+
```
438
+
439
+
In `always` you will have error, in `onNamespaceEncountered` you will have none error.
440
+
441
+
Declares a namespaces in the foo root element:
442
+
443
+
```xml
444
+
<fooxmlns="http:foo" >
445
+
<prefix:bar />
446
+
</foo>
447
+
```
448
+
449
+
In `onNamespaceEncountered` you will see a prefix error.
450
+
451
+
## xml.validation.schema.enabled
452
+
423
453
The `xml.validation.schema.enabled` gives the capability to enable / disable the validation based on XSD. It can be configured with 3 values:
Copy file name to clipboardExpand all lines: package.json
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -307,6 +307,22 @@
307
307
"markdownDescription": "Enable/disable all validation. Default is `true`.",
308
308
"scope": "window"
309
309
},
310
+
"xml.validation.namespaces.enabled": {
311
+
"type": "string",
312
+
"default": "always",
313
+
"enum": [
314
+
"always",
315
+
"never",
316
+
"onNamespaceEncountered"
317
+
],
318
+
"markdownEnumDescriptions": [
319
+
"Enable namespaces validation.",
320
+
"Disable namespaces validation.",
321
+
"Enable namespaces validation only when the root element declares an xmlns namespace."
322
+
],
323
+
"markdownDescription": "Enable/disable namespaces validation. Default is `always`. Ignored if `#xml.validation.enabled#` is set to `false`. See [here](command:xml.open.docs?%5B%7B%22page%22%3A%22Validation%22%2C%22section%22%3A%22xmlnamespaceschemaenabled%22%7D%5D) for more information.",
0 commit comments