我是 xlm 檔案的新手,我希望解決方案很簡單。我在 node.js 中用 xml-writer 構建了一個檔案。如何在檔案中插入換行符或縮進?謝謝
xw = new XMLWriter();
xw.startDocument("1.0", "UTF-8");
xw.startElement("1st element");
xw.writeAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
xw.writeAttribute(
"A",
"B"
);
xw.startElement("Lot");
xw.startElement("RAW");
xw.writeAttribute("E", F);
xw.endElement();
xw.endDocument()
uj5u.com熱心網友回復:
我不熟悉它,但 XMLWriter 的建構式似乎有一個“縮進”引數。試試new XmlWriter(true)。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/334362.html
下一篇:htmlepg到xml通過php
