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.
如何将原始 XML 字符串读入 jdom2 进行操作?我在网上找到的一切都是从 url 加载文件。
它们还公开了从 java.io.Reader 加载 XML 的方法,在这种情况下,您可以从 String 创建 StringReader,如下所示:
StringReader xmlReader = new StringReader(myXmlString);