javascript - Node.js: How to create XML files -
Is there a good way to create XML files? For example, like the builder (or any other way) for the rail?
Thank you
It seems that the library can do this for you. If you have NPM installed, you can do This will let you do (taken from their example): As a result: npm install xmlbuilder .
var requires builder = 'xmlbuilder'); Var doc = builder.create (); ('For', 'node-js') .ele ('repo') .att ('type', 'git') .txt ('' for '' xmlbuilder '' .git: //github.com /oozcitak/xmlbuilder-js.git ') .up () .up () .ele (' test ') .txt (' absolute '); Console.log (doc.toString ({beautiful: true}));
& lt; Root & gt; & Lt; Xmlbuilder for = "node-js" & gt; & Lt; Repo type = "git" & gt; Git: //github.com/oozcitak/xmlbuilder-js.git< / Repo & gt; & Lt; / Xmlbuilder & gt; & Lt; Test & gt; Full & lt; / Test & gt; & Lt; / Root & gt;
Comments
Post a Comment