-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Report error on invalid XML catalog URI #1270
Conversation
.../java/org/eclipse/lemminx/extensions/contentmodel/participants/diagnostics/XMLValidator.java
Outdated
Show resolved
Hide resolved
.../java/org/eclipse/lemminx/extensions/contentmodel/participants/diagnostics/XMLValidator.java
Outdated
Show resolved
Hide resolved
...x/src/main/java/org/eclipse/lemminx/extensions/catalog/XMLCatalogDiagnosticsParticipant.java
Outdated
Show resolved
Hide resolved
...x/src/main/java/org/eclipse/lemminx/extensions/catalog/XMLCatalogDiagnosticsParticipant.java
Outdated
Show resolved
Hide resolved
I dont remember if we can do that but what about if uri starts with http:// |
...x/src/main/java/org/eclipse/lemminx/extensions/catalog/XMLCatalogDiagnosticsParticipant.java
Outdated
Show resolved
Hide resolved
@@ -90,7 +90,8 @@ public enum XMLSchemaErrorCode implements IXMLErrorCode { | |||
TargetNamespace_2("TargetNamespace.2"), // | |||
SchemaLocation("SchemaLocation"), // | |||
schema_reference_4("schema_reference.4"), // | |||
src_element_3("src-element.3"); | |||
src_element_3("src-element.3"), // | |||
catalog_uri("catalog_uri"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The catalog_uri
error is not an error coming from XML validation based on XSD. Please remove it and create a XMLCatalogErrorCode
in the catalog extensions
|
||
for (CatalogEntry catalogEntry : CatalogUtils.getCatalogEntries(xmlDocument)) { | ||
String path = CatalogUtils.getResolvedLocation(xmlDocument, catalogEntry); | ||
if (!FilesUtils.isValidPath(FilesUtils.getPath(path)) && URIUtils.isFileResource(path)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly, it means that CatalogUtils.getResolvedLocation returns a path with file://
scheme even if the original uri doesn't starts with file://
If it that could you add a comment here with this information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that's correct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok thanks,could you add a comment here with a sample too (uri="foo/bar.xsd" -> path=file://.....bar.xsd
Signed-off-by: Jessica He <jhe@redhat.com>
It works like a charm: Great job @JessicaJHee ! |
Fixes #823
Signed-off-by: Jessica He jhe@redhat.com