1 16 package org.apache.wsdl.util; 17 18 import org.w3c.dom.Document ; 19 import org.xml.sax.SAXException ; 20 21 import javax.xml.parsers.DocumentBuilder ; 22 import javax.xml.parsers.DocumentBuilderFactory ; 23 import javax.xml.parsers.ParserConfigurationException ; 24 import java.io.IOException ; 25 import java.io.InputStream ; 26 27 30 public class Utils { 31 40 public static Document newDocument(InputStream in) 41 throws ParserConfigurationException , SAXException , IOException { 42 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); 43 dbf.setNamespaceAware(true); 44 DocumentBuilder db = dbf.newDocumentBuilder(); 45 return db.parse(in); 46 } 47 } 48 | Popular Tags |