Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用 Xerces (xercesImpl-2.8.1.jar) 将 Xml 字符串转换为 XML DOM 对象。
但似乎它只提供了以下方法,它没有提供将 XML 字符串转换为 Object 的方法。
parse(File f)
parse(InputSource is)
parse(InputStream is)
parse(String uri)
任何指针都会很棒。
可以将 XML 字符串转换为Reader
Reader
java.io.StringReader xmlReader = new java.io.StringReader(xml); Document doc = docBuilder.parse(new InputSource(xmlReader));