Java XML Parse String parse(String xml)

Here you can find the source of parse(String xml)

Description

parse

License

Mozilla Public License

Declaration

public static Document parse(String xml) throws Exception 

Method Source Code


//package com.java2s;
//License from project: Mozilla Public License 

import java.io.StringReader;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;

public class Main {
    public static Document parse(String xml) throws Exception {
        return DocumentBuilderFactory.newInstance().newDocumentBuilder()
                .parse(new InputSource(new StringReader(xml)));
    }/*from   w  ww  .  jav a2s  .  co  m*/
}

Related

  1. parse(String input, char delim, char esc)
  2. parse(String line)
  3. parse(String line)
  4. parse(String s)
  5. parse(String text)
  6. parse(String xml)
  7. parse(String xml)
  8. parse(String xml)
  9. parse(String xml)