0
我正在嘗試將org.w3c.dom.Document
寫入文件。我得到的Document
從將XML文檔寫入Java文件時出錯
String URL = "http://...."
DOMParser parser = new DOMParser();
Document doc = null;
try {
parser.parse(new InputSource(URL));
doc = parser.getDocument();
} catch() {}
然後我寫這篇文章Document
使用
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer();
DOMSource source = new DOMSource(doc);
StreamResult result = new StreamResult(new File(file));
transformer.transform(source, result);
雖然這樣做我不斷收到以下錯誤
ERROR: 'Namespace for prefix 'xlink' has not been declared.'
什麼可能是錯誤的文件?謝謝