Newbi XML resource mapping question
Hi!
I am playing around with a product configuration file that starts with this:
<cache-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.oracle.com/coherence/coherence-cache-config"
xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-cache-config coherence-cache-config.xsd">
I have managed to map the "http://xmlns.oracle.com/coherence/coherence-cache-config" to the XML schema file on my local drive. The "coherence-cache-config.xsd" is however still red in my IDE. What am I suposed to do to get rid of that error?
Sorry that I am such a total newd when it comes to XML - please keep any sugestions easy to follow :-)
请先登录再写评论。
Hi Magnus,
All you need is to instruct the IDE where to find the schema document. You can do that as follows:
Denis
Thanks for the sugestion but the last part of the last line (i.e. "coherence-cache-config.xsd") is still red after doing that. XML tag expansion etc do however work so I am not sure if the problem has any negative effect (except disturbing me - I always want to get rid of all errors and warnings)...
Please provide minimal project that illustrates that (basically, it should contain two files - *.xml that references the schema and schema file itself).
Denis
Sorry, checked that 'coherence-cache-config.xsd' is really highlighted as red. The reason is that your setup implies that schema file is available locally. You can remove that error highlighting by putting 'coherence-cache-config.xsd' at the project. Alternative approach is to define correct url for the schema document (like mentioned at the example here).
Denis
In my case the coherence-cache-config.xsd file is included in the coherence.jar file that I have added as a library to my project.
I am not sure I understrod your two sugestions :
1. Extracxt the file and place it together with my XML file?
2. Change the URI. The link to the w3.org page did not tell me how to reformulate the URI - as I said I am a total XML newd and hardly ever understand the w3 pages very well :-(
Lets say I have a coherence.jar (with the xsd file in it on the top level) located in a lib catalog under my project directory. How should the URI look in this case?
Let me check what resource resolving strategies are available at IJ.
I'll post the update later.
Denis
All you need to do is adjust 'External Resources' configuration discussed earlier - change the uri from 'http://xmlns.oracle.com/coherence/coherence-cache-config' to 'coherence-cache-config.xsd'.
Denis
Thanks a lot - that got rid of the error!!!!!
/Magnus