-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
1 parent
ee4950e
commit 6e5a906
Showing
10 changed files
with
637 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...inx/src/main/java/org/eclipse/lemminx/extensions/contentmodel/settings/SchemaEnabled.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* Copyright (c) 2021 Red Hat Inc. and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Red Hat Inc. - initial API and implementation | ||
*/ | ||
package org.eclipse.lemminx.extensions.contentmodel.settings; | ||
|
||
public enum SchemaEnabled { | ||
always, never, onValidSchema; | ||
} |
56 changes: 56 additions & 0 deletions
56
...src/main/java/org/eclipse/lemminx/extensions/contentmodel/settings/XMLSchemaSettings.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** | ||
* Copyright (c) 2021 Red Hat Inc. and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v2.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Red Hat Inc. - initial API and implementation | ||
*/ | ||
package org.eclipse.lemminx.extensions.contentmodel.settings; | ||
|
||
/** | ||
* XML Schema settings. | ||
* | ||
*/ | ||
public class XMLSchemaSettings { | ||
|
||
public XMLSchemaSettings() { | ||
setEnabled(SchemaEnabled.always); | ||
} | ||
|
||
private SchemaEnabled enabled; | ||
|
||
public void setEnabled(SchemaEnabled enabled) { | ||
this.enabled = enabled; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
final int prime = 31; | ||
int result = 1; | ||
result = prime * result + ((enabled == null) ? 0 : enabled.hashCode()); | ||
return result; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) | ||
return true; | ||
if (obj == null) | ||
return false; | ||
if (getClass() != obj.getClass()) | ||
return false; | ||
XMLSchemaSettings other = (XMLSchemaSettings) obj; | ||
if (enabled != other.enabled) | ||
return false; | ||
return true; | ||
} | ||
|
||
public SchemaEnabled getEnabled() { | ||
return enabled; | ||
} | ||
} |
Oops, something went wrong.