-
Notifications
You must be signed in to change notification settings - Fork 82
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
Bind XSD, DTD with CodeLens #395
Comments
Just for information, today we have a code action on the root element (if XML is not bound to a XSD/DTD) which
But I agree this code action doesn't provide the capability to bind the XML with an existing XSD, DTD. I think the best mean should be to provide two vscode command
available for the current XML file. When this command is executed:
After the selected XSD, DTD file, it should generate the proper association according the binding strategy choose in the step 1. |
Thanks for your quick answer! I think that "validate with XSD|DTD" would lead people to believe that the XML document itself is unchanged. "Associate with XSD|DTD" on the other hand implies that the XML document itself is changed (i.e. special attributes added to the root element). For your extension to perform the validation is it absolutely necessary for the XML document itself to contain the association, e.g. with |
You are welcome! I had this idea in my mind since several time,but I waited for user issue to know if it was relevant. Thanks for having created this issue :)
Totally agree with you, yes command should be named with
No, there are several binding strategy like xml-model, xsi:schemaLocation, xsi:noNamespaceLocation which are standard associations and we provide a non standard association with XML file association where you declare the association with a settings (it avoid to polluate the XML with this association) or with XML catalog. Managing XML file association or XML catalog should be very nice but I'm not sure it will be easy to implement. |
Thanks, Sorry I was not very clear: I meant does your extension need the association to be physically present either in the XML document itself, a catalog or the settings? I was asking because if that is true, then it would be understandable that such an action would be called "Validate" instead of "associate" - because validation implies changing or creating files or settings. Anyway, would be great to have a button / action like this. |
Yes you need to store association somewhere. Otherwise how to know this association?
As I said you, I'm totally agree with you and vscode commands should be called
vscode command is the standard support to do that. |
Yes sure. I think the best mean to support this issue is to use CodeLens when XML is not bound to a grammar like this [Associate with XSD] [Associate with DTD] [Associate with RelaxNG] [Associate with Schematron]
<root>
</root> |
See redhat-developer/vscode-xml#395 Signed-off-by: azerr <[email protected]>
Fixes redhat-developer#395 Signed-off-by: azerr <[email protected]>
See redhat-developer/vscode-xml#395 Signed-off-by: azerr <[email protected]>
See redhat-developer/vscode-xml#395 Signed-off-by: azerr <[email protected]>
Fixes redhat-developer#395 Signed-off-by: azerr <[email protected]>
See redhat-developer/vscode-xml#395 Signed-off-by: azerr <[email protected]>
See redhat-developer/vscode-xml#395 Signed-off-by: azerr <[email protected]>
See redhat-developer/vscode-xml#395 Signed-off-by: azerr <[email protected]>
See redhat-developer/vscode-xml#395 Signed-off-by: azerr <[email protected]>
See redhat-developer/vscode-xml#395 Signed-off-by: azerr <[email protected]>
See redhat-developer/vscode-xml#395 Signed-off-by: azerr <[email protected]>
See redhat-developer/vscode-xml#395 Signed-off-by: azerr <[email protected]>
Fixes redhat-developer#395 Signed-off-by: azerr <[email protected]>
See redhat-developer/vscode-xml#395 Signed-off-by: azerr <[email protected]>
Fixes redhat-developer#395 Signed-off-by: azerr <[email protected]>
Fixes redhat-developer#395 Signed-off-by: azerr <[email protected]>
See redhat-developer/vscode-xml#395 Signed-off-by: azerr <[email protected]>
See redhat-developer/vscode-xml#395 Signed-off-by: azerr <[email protected]>
See redhat-developer/vscode-xml#395 Signed-off-by: azerr <[email protected]>
Fixes redhat-developer#395 Signed-off-by: azerr <[email protected]>
Fixes redhat-developer#395 Signed-off-by: azerr <[email protected]>
Fixes redhat-developer#395 Signed-off-by: azerr <[email protected]>
Fixes redhat-developer#395 Signed-off-by: azerr <[email protected]>
Fixes redhat-developer#395 Signed-off-by: azerr <[email protected]>
@bricksdont once my PR will be merge you should benefit with that: |
This looks awesome! I will definitely test it once available. If the PR is merged to the main branch, can I get this version by updating inside VS Code? |
Fixes redhat-developer#395 Signed-off-by: azerr <[email protected]>
Fixes redhat-developer#395 Signed-off-by: azerr <[email protected]>
Fixes redhat-developer#395 Signed-off-by: azerr <[email protected]>
Fixes #395 Signed-off-by: azerr <[email protected]>
A very useful feature for an XML IDE would be a button or action to associate an XML document that is currently open in VS Code with a schema file.
After clicking a button, a file dialog would open which would allow to select an XSD file from the file system. Then, your XML extension would insert into the XML document the correct attributes or processing instructions needed to make this association.
The reason why that would be useful is that there are several ways to associate an XML document with an XSD file:
https://github.com/redhat-developer/vscode-xml/blob/master/docs/Validation.md#validation-with-xsd-grammar
all of them cumbersome, and hard to remember. Especially because you also have to pay close attention and be aware that it makes a difference whether the XML document to be associated has a namespace or not.
Oxygen has functionality like this and I find it very useful.
The text was updated successfully, but these errors were encountered: