Problem with xsd:schema for xmlns:jaxb
Answered
I have an XSD with the following schema definition:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0">
Where http://java.sun.com/xml/ns/jaxb gave an error asking me to register it in Settings/LanguagesAndFrameworks/SchemasAndDTDs, which I did. Then it threw the following error in the xsd:schema:
Expecting namespace 'http://java.sun.com/xml/ns/jaxb', but the target namespace of the schema document is 'null'.
Any ideas about what is the problem and how to solve it?
I am on Ultimate 2022.2.4.
Please sign in to leave a comment.
You can get the schema at http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd and map it manually like this:
So you are saying that instead of referencing a URI on the web you are suggesting I download the bindingschema_2_0.xsd, put it somewhere in my filesystem, then tell IntelliJ to map it as an external schemal to that specific file.
Seems weird, but it works and I think that is what you mean. Is that correct?
You can also use this code:
Then fetch the external resource for the xsd file using alt+enter menu.