64
65 Document doc1 = parse(data);
66 Document doc2 = docBuilder.newDocument();
67
68 Node element = doc2.adoptNode(doc1.getDocumentElement());
69
70 System.out.println("OK.");
71 } catch (Exception e) {
72 e.printStackTrace();
73 Assert.fail("Excpetion while adopting node: " + e.getMessage());
74 }
75
76 }
77
78 private Document parse(String xmlData) throws Exception {
79 StringReader in = new StringReader(xmlData);
80 InputSource source = new InputSource(in);
81 return docBuilder.parse(source);
82 }
83 }
84
|
64
65 Document doc1 = parse(data);
66 Document doc2 = docBuilder.newDocument();
67
68 Node element = doc2.adoptNode(doc1.getDocumentElement());
69
70 System.out.println("OK.");
71 } catch (Exception e) {
72 e.printStackTrace();
73 Assert.fail("Excpetion while adopting node: " + e.getMessage());
74 }
75
76 }
77
78 private Document parse(String xmlData) throws Exception {
79 StringReader in = new StringReader(xmlData);
80 InputSource source = new InputSource(in);
81 return docBuilder.parse(source);
82 }
83 }
|