Nested exception: no protocol: <?xml version="1.0" encoding="GBK" standalone="yes"?>
出现原因:
Document document = reader.read(beanXml1);
因为read方法的参数如果是String的话,只能为url或者文件路径
解决方案:
Document document = reader.read(new ByteArrayInputStream(beanXml1.getBytes(StandardCharsets.UTF_8)));
版权属于:virgo's blog(除特别注明外)
本文链接:https://blog.scqloud.cn/archives/6.html
转载时须注明出处及本声明