简体   繁体   中英

Xerces - XmlString to Dom object

I am trying to convert an Xml String to XML DOM object using Xerces (xercesImpl-2.8.1.jar).

But it seems that it provides only following methods, it does not offer a method that would take an XML string and convert it to an Object.

  • parse(File f)
  • parse(InputSource is)
  • parse(InputStream is)
  • parse(String uri)

Any pointers would be great.

One can convert the XML string to a Reader

java.io.StringReader xmlReader = new java.io.StringReader(xml);
Document doc = docBuilder.parse(new InputSource(xmlReader));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM