[Question] URIResolverExtension and XML Validation
My understanding of the validation in XML server for an XML file is that it is done within LSPSAXParser and all schema related errors (i.e. attribute present missing from the schema) reported by LSPSAXParser via LSPErrorReporterForXML...
How does the validation take advantage of URIResolverExtension... For example my URIResolverExtension resolves NS URI to a local file URL and then schema is loaded from the local file... I wasn't able to find yet how validation would account for schema loaded from a local file with a help of URI Resolver. Is it supported at all?
My understanding of the validation in XML server for an XML file is that it is done within LSPSAXParser and all schema related errors (i.e. attribute present missing from the schema) reported by LSPSAXParser via LSPErrorReporterForXML...
Exactly!
How does the validation take advantage of URIResolverExtension... For example my URIResolverExtension resolves NS URI to a local file URL and then schema is loaded from the local file... I wasn't able to find yet how validation would account for schema loaded from a local file with a help of URI Resolver. Is it supported at all?
URIResolverExtension extends xerces XMLEntityResolver implementation and it is registered in URIResolverExtensionManager (which stores list of URIResolverExtension ) which extends too XMLEntityResolver .
When validation occurs, the URIResolverExtensionManager is set in SAX parser at https://github.com/eclipse/lemminx/blob/c1f855c3de281ecc7db36f908df51cbb60e9d50c/org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/extensions/contentmodel/participants/diagnostics/XMLValidator.java#L77
In otherwise it should call your URIResolverExtension#resolveEntity (which does nothing by default). Please note URIResolverExtension is used too for XML completion / hover based on XSD/DTD.
I wasn't able to find yet how validation would account for schema loaded from a local file with a help of URI Resolver. Is it supported at all?
You mean validate XML with a XSD from a local file, it should work. I don't know if my answer is enough, if you have some trouble please share your code.