I am working on a code to avoid XXE attacks. So I was required to use DocumentBuilderFactory
and use the setFeature
method of the same class to set a .xsd file as the feature.
For example, the .xsd file is stored in the C drive. So I've been using the code as:
...
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setFeature("file:///C:/mapp.xsd", true);
...
However, this is giving the ParserConfigurationException with the error:
Feature 'file:///C:/mapp.xsd' is not recognized.
I have to work with this local file as it is the client's requirement so any help regarding this would be awesome :)
Thanks.