I suggest you remove this DOCTYPE. At this step you will see no errors, no completion based on XSD. You need to write a XML catalog which defines a mapping between uri and XSD.
Create a XML file catalog gwt-catalog.xml like this :
... page stuff here ...
Is that?
I suggest you remove this DOCTYPE. At this step you will see no errors, no
completion based on XSD. You need to write a XML catalog which defines a
mapping between uri and XSD.
Create a XML file catalog gwt-catalog.xml like this :
GWT Eclipse plugin does that too
https://github.com/gwt-plugins/gwt-eclipse-plugin/blob/d2478f8ca89d7c388442f810cec0a44f8962aa22/plugins/com.gwtplugins.gwt.eclipse.core/plugin.xml#L946
And after that you need to register the catalog with WWD preferences:
[image: image]
Once you did that, you can open your XML and you should benefit with
completion based on XSD:
[image: image]
Please note that as UiBinder is defined in
http://dl.google.com/gwt/dtd/uibinder.xsd as mixed:
you can write any element inside it (you will not have some error).
Next Issue - Imbedded ,
or unsubscribe
.
The only thing that WWD must provide is the settings xml.validation.resolveExternalEntities to enable resolve external entities which can be dangerous.
From Wild Web Developer, it looks like this is more a UX issue that a bug.
What I think is missing:
Some warning in the xmlns attributes to mention that it's not resolved
a quick fix/code action on such warning, to "configure XML catalogs", this could use a client-side command which the IDEs can decide to interpret at they want (eg showing the preference page for Eclipse IDE).
@angelozerr do you want me to open tickets to lemminx about that, or are those stories already covered is some way Wild Web Developer fails at leveraging?
For this example, I'd suggest @RobertMolenda you use actual XSD path (eg http://dl.google.com/gwt/dtd/uibinder.xsd ) in the xmlns elements instead of the "to be resolved" urn: ones.
Some warning in the xmlns attributes to mention that it's not resolved
XML errors are reported by Xerces, and in this case, Xerces consider that it's a XML valid, because you can use namespace without XSD association. I think it's possible to support this warning, but I'm not sure it's an easy task.
When XML is not bound to a XSD, DTD grammar, you can see an information on the root element. The last release of LemMinx provides several code actions to generate XSD / DTD and associate it:
a quick fix/code action on such warning, to "configure XML catalogs", this could use a client-side command which the IDEs can decide to interpret at they want (eg showing the preference page for Eclipse IDE).
I think it's a new CodeAction that we should implement like we did to generate XSD, DTD. An idea is to generate the XML catalog and if LSP client have the capability,it can register the catalog on settings client side. We did this kind of feature when XML catalog path is wrong.
For this example, I'd suggest @RobertMolenda you use actual XSD path (eg http://dl.google.com/gwt/dtd/uibinder.xsd ) in the xmlns elements instead of the "to be resolved" urn: ones.
Why, XML catalogs is working for that, no? I'm not sure that @RobertMolenda want to modify the gwt xml which uses namespaces.
What's to be done on LSP4E on that matter? It seems like everything is in place to make it work.
For which feature?
To fix this issue WWD should provide the settings xml.validation.resolveExternalEntities to enable resolve external entities which can be dangerous. IMHO I think WWD should expose as UI preferences all LemMinx settings (enable codelens, format settings, etc) and settings which give the same behaviour than WTP editor (see https://github.com/eclipse/wildwebdeveloper/issues/557).
Validation Issues with {module}.ui.xml
Sample XML <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent"> <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:gxt="urn:import:com.sencha.gxt.widget.core.client.form" xmlns:c="urn:import:com.blazent.web.client.widgets.controls" xmlns:gxtcontainer="urn:import:com.sencha.gxt.widget.core.client.container" xmlns:sl="urn:import:com.blazent.web.client.widgets.saveLoadOverlay" xmlns:form="urn:import:com.sencha.gxt.widget.core.client.form" xmlns:w="urn:import:com.blazent.web.client.widgets" xmlns:html="urn:import:com.blazent.web.client.widgets.html" xmlns:button="urn:import:com.blazent.web.client.widgets.button" xmlns:lists="urn:import:com.blazent.web.client.widgets.lists">
Can you please try latest snapshot from https://download.eclipse.org/wildwebdeveloper/snapshots/ and report whether this works or not?
At first I think you have this error because you declare DOCTYPE like:
Is that?
I suggest you remove this DOCTYPE. At this step you will see no errors, no completion based on XSD. You need to write a XML catalog which defines a mapping between uri and XSD.
Create a XML file catalog
gwt-catalog.xml
like this :GWT Eclipse plugin does that too https://github.com/gwt-plugins/gwt-eclipse-plugin/blob/d2478f8ca89d7c388442f810cec0a44f8962aa22/plugins/com.gwtplugins.gwt.eclipse.core/plugin.xml#L946
And after that you need to register the catalog with WWD preferences:
Once you did that, you can open your XML and you should benefit with completion based on XSD:
Please note that as UiBinder is defined in http://dl.google.com/gwt/dtd/uibinder.xsd as mixed:
you can write any element inside it (you will not have some error).
I suggest that you create an issue for that, because by default the XML Language Server disable the load of external entities (for security reason). You can enable it with
xml.validation.resolveExternalEntities
like we do in vscode-xml https://github.com/redhat-developer/vscode-xml/blob/master/docs/Validation.md#resolve-external-entities but WWD doesn't provide this preference. Please create it.Unfortunately, the problem remains.
On Tue, Nov 24, 2020 at 1:46 PM Mickael Istria notifications@github.com wrote:
Angelo - THANK YOU - great explanation!! I hate when eclipse updates that it enables security that causes errors like this.
On Wed, Nov 25, 2020 at 3:28 AM Angelo notifications@github.com wrote:
Which problems? You have again a validation problem even if you remove the DOCTYPE?
if you configure catalog, you should have completion based on XSD, no?
It's not Eclipse, it's the default behavior of the XML Language Server used https://github.com/eclipse/lemminx/
It prevent from XXE atacks, see https://www.shielder.it/blog/2019/10/dont-open-that-xml-xxe-to-rce-in-xml-plugins-for-vs-code-eclipse-theia/
The only thing that WWD must provide is the settings
xml.validation.resolveExternalEntities
to enable resolve external entities which can be dangerous.From Wild Web Developer, it looks like this is more a UX issue that a bug. What I think is missing:
@angelozerr do you want me to open tickets to lemminx about that, or are those stories already covered is some way Wild Web Developer fails at leveraging?
For this example, I'd suggest @RobertMolenda you use actual XSD path (eg http://dl.google.com/gwt/dtd/uibinder.xsd ) in the xmlns elements instead of the "to be resolved"
urn:
ones.XML errors are reported by Xerces, and in this case, Xerces consider that it's a XML valid, because you can use namespace without XSD association. I think it's possible to support this warning, but I'm not sure it's an easy task.
When XML is not bound to a XSD, DTD grammar, you can see an information on the root element. The last release of LemMinx provides several code actions to generate XSD / DTD and associate it:
I think it's a new CodeAction that we should implement like we did to generate XSD, DTD. An idea is to generate the XML catalog and if LSP client have the capability,it can register the catalog on settings client side. We did this kind of feature when XML catalog path is wrong.
Why, XML catalogs is working for that, no? I'm not sure that @RobertMolenda want to modify the gwt xml which uses namespaces.
What's to be done on LSP4E on that matter? It seems like everything is in place to make it work.
For which feature?
To fix this issue WWD should provide the settings
xml.validation.resolveExternalEntities
to enable resolve external entities which can be dangerous. IMHO I think WWD should expose as UI preferences all LemMinx settings (enable codelens, format settings, etc) and settings which give the same behaviour than WTP editor (see https://github.com/eclipse/wildwebdeveloper/issues/557).