Skip to content
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

Provide automatic completion/validation in catalog file #204

Closed
fbricon opened this issue Nov 7, 2018 · 12 comments
Closed

Provide automatic completion/validation in catalog file #204

fbricon opened this issue Nov 7, 2018 · 12 comments
Assignees
Labels
catalog completion This issue or enhancement is related to completion support enhancement New feature or request in progress validation
Milestone

Comments

@fbricon
Copy link
Contributor

fbricon commented Nov 7, 2018

Ideally, we should get completion in catalog files:

<?xml version="1.0"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
    //Should provide completion here
</catalog> 
@fbricon fbricon added enhancement New feature or request completion This issue or enhancement is related to completion support validation labels Nov 7, 2018
@angelozerr
Copy link
Contributor

To do that we must return the well XML Schema according the xmlns. We have 2 choices:

  • using an XML catalog
  • develop that in Java with a plugin like the XMLPlugin

@angelozerr
Copy link
Contributor

@ralfhandl I think you could be interested with this issue: Please give us feedback

@ralfhandl
Copy link

I'd definitely like to have automatic completion/validation of catalog files. Got validation of my catalog.xml working by starting it with

<?xml version="1.0"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
  <public publicId="urn:oasis:names:tc:entity:xmlns:xml:catalog" uri="./schemas/catalog.xsd" />
  <uri name="urn:oasis:names:tc:entity:xmlns:xml:catalog" uri="./schemas/catalog.xsd" />

Now vscode-xml knows how to validate catalog files 😄

Would it be possible to have an "implicit" catalog with these entries that is packed into vscode-xml, together with the catalog XSD? I got http://xmlcatalogs.org/schema/1.1/catalog.xsd from http://xmlcatalogs.org/.

PS: I'm no expert on XML catalogs but it strikes me as odd that I always need two catalog entries for the same XML namespace:

  • <pubic /> to make code completion work,
  • <uri /> to make validation work

Should I open a separate issue for that`?

@angelozerr
Copy link
Contributor

Would it be possible to have an "implicit" catalog with these entries that is packed into vscode-xml, together with the catalog XSD

My work with 84391cb#diff-13747ce199e06fc38bd7e093a60e4a34R34 should call the http://xmlcatalogs.org/schema/1.1/catalog.xsd from http://xmlcatalogs.org/ when "urn:oasis:names:tc:entity:xmlns:xml:catalog" is declared, it works great in my laptob, but we have test problem that I must fix it to enable it again.

But for the moment, if you wish to have completion and validation for catalog, you can declare your XMl Schema in your catalog and it should work.

PS: I'm no expert on XML catalogs but it strikes me as odd that I always need two catalog entries for the same XML namespace:

Yes you hav ethis problem, please create an issue for that. I must debug Xerces to understand how it works (me too I don't know catalog).

@angelozerr
Copy link
Contributor

Now #215 was fixed, I have re-enabled XML Catalog plugin. If build tests passed, this issue should be fixed.

@angelozerr
Copy link
Contributor

@ralfhandl build is passing, please retry this issue, thanks!

@ralfhandl
Copy link

@angelozerr not sure what was fixed/changed: validation and completion of "my" XML files (still) works with build #502.

Validation and completion of catalog files only works if the catalog contains the entry

  <public publicId="urn:oasis:names:tc:entity:xmlns:xml:catalog" uri="./schemas/catalog.xsd" />

Needing <public> instead of (and in other cases in addition to) <uri> is still surprising, I have cross-checked with the XML Catalog specification and opened #217 as a separate issue.

Thanks for the quick support!

@angelozerr
Copy link
Contributor

Sorry @ralfhandl please reinstall it, now you should have compeltion and validation (based on XML Schema catalog) for :

<?xml version="1.0"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
    //Should provide completion here
    <bad /> // error validation, because "bad" doesn't belong to the XML Schema catalog
</catalog> 

validation and completion of "my" XML files (still) works with build #502.

Yes sure, but this issue os for your XML catalog file, not for XML files bound to the catalog.

Needing instead of (and in other cases in addition to) is still surprising, I have cross-checked with the XML Catalog specification and opened #217 as a separate issue.

Yes I know. I will study more #217

@angelozerr
Copy link
Contributor

Here a demo:

catalogcompletionandvalidation

@angelozerr angelozerr added this to the v0.0.3 milestone Nov 12, 2018
@ralfhandl
Copy link

+1, works now with build #505

@fbricon
Copy link
Contributor Author

fbricon commented Nov 15, 2018

@angelozerr are there any tests so we can close this one?

@angelozerr
Copy link
Contributor

No I must write tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
catalog completion This issue or enhancement is related to completion support enhancement New feature or request in progress validation
Projects
None yet
Development

No branches or pull requests

3 participants