| | |
| | | |
| | | import com.oying.exception.BadRequestException; |
| | | import org.dom4j.Document; |
| | | import org.dom4j.DocumentException; |
| | | import org.dom4j.Element; |
| | | import org.dom4j.io.SAXReader; |
| | | import org.xml.sax.InputSource; |
| | |
| | | /** |
| | | * 转XML map |
| | | */ |
| | | public static Map<String, String> toMap(byte[] xmlBytes, String charset) throws Exception { |
| | | public static Map<String, String> toMap(byte[] xmlBytes, String charset) throws DocumentException { |
| | | SAXReader reader = new SAXReader(false); |
| | | InputSource source = new InputSource(new ByteArrayInputStream(xmlBytes)); |
| | | source.setEncoding(charset); |