3
我需要使用javax.xml.transform.Transformer的結果作爲另一個Transformer的輸入,而不將結果保存到文件中。這是...嵌套XML變形金剛
Reader input = new StringReader(xml); // Where xml is a String
StringWriter output = new StringWriter();
StreamSource source = new StreamSource(input);
StreamResult result = new StreamResult(output);
transformer1.transform(source1, result1);
// Get contents of result1 into source2
transformer2.transform(source2, result2);