How to disable DTD fetching using JAXB2.0

前端 未结 5 1883
执念已碎
执念已碎 2020-12-02 17:54

I\'m trying to use JAXB to unmashall some XML which I used xjc to create in the first place. I don\'t want to do any validation on the unmarshalling, but even though I have

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-02 18:10

    The above suggestions Nothing worked out for me... Im suggesting this code which worked for me☺️ To remove Dtd from xml ...Used regex String str = event.getData(); str= str.replaceAll("](?:]>[^<>])>","");

提交回复
热议问题