Java 中如何產生XML文件

專題用的工作日誌 – 使用java中的DOM來抓取資料庫資料產生xml,套上xslt產生HTML(含編碼問題)

DocumentBuilder builder = factory.newDocumentBuilder();
Document document=builder.newDocument();
//根
Element root=(Element)document.createElement(“overview");
//元素1
Element child1=document.createElement(“Search_information");
//元素2
Element child1_1=document.createElement(“Search_tag");
child1_1.appendChild(document.createTextNode(“測試tag"));
//root.appendChild(child2);

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *

What is 12 + 12 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)