更新时间:2022-01-24 04:40:51
我的代码库中有这个功能,这应该适合你.
I have this function in my code base, this should work for you.
public static Document loadXMLFromString(String xml) throws Exception
{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
InputSource is = new InputSource(new StringReader(xml));
return builder.parse(is);
}
另见这个类似的问题
Eclipse-绝对uri:无法在web.xml或与此应用程序一起部署的jar文件中解析http://java.sun.com/jsp/jstl/core
绝对uri:http://java.sun.com/jsp/jstl/core不能在web.xml或与此应用程序一起部署的jar文件中解析
绝对 uri:http://java.sun.com/jsp/jstl/core 无法在 web.xml 或使用此应用程序部署的 jar 文件中解析
绝对 uri:http://java.sun.com/jsp/jstl/core 无法在 web.xml 或在 tomcat 中使用此应用程序错误部署的 jar 文件中解析
绝对 uri:http://java.sun.com/jstl/core 无法在 web.xml 或使用此应用程序部署的 jar 文件中解析