Ah! I'm catching up with you now. I think what you've said is that you ARE implementing the custom resolver. And your implementation is not quite where you would like it to be.
If you implement your interface, you can hand your implementation a mapping file of some kind (as part of its configuration), rather like @Paul has suggested. There is even a well known concept for this. That would get you everything, but you would need to define your resource strings just so, and if you added things later, you would need to change that file.
The concept is "catalog". Xerces defines it in this URL
https://xerces.apache.org/xerces2-j/faq-xcatalogs.html . Sorry, I have not done this for a while.
Other hints that could help, are "getResource()" returning a URL. I think the URL returned will be a "file:" URL. Then, if you must open a file, you may be able to get the URL and parse the true file location out of that. It might be, for example, everything after
protocol://.
Good luck.