有没有人为elisp编写任何库以进行CGI编程?我把一个快速的第一个脚本拼凑在一起.但是,我只是一个长期的emacs用户,我从来没有真正编程过它.当我看到我可以用emacs而不是bash编写脚本(--script)时,我想我会试一试.
#!/usr/bin/emacs --script
(princ "Content-type: text/html; charset=utf-8\n\n")
(progn (princ "<html>\n")
(princ "<body>\n")
(princ "<h1 style='text-align: center'>Elisp CGI Programming</h1>"))
(progn (princ "<table style='border:1px solid'>")
(princ "<tr><th>One</th><th>Two</th></tr>")
(princ "<tr><th>A</th><th>B</th></tr>")
(princ "</table>")
(princ "</body>")
(princ "</html>")
)
如果可能的话,我怎么能以编程方式编辑Emacs Lisp中的xml数据?
我需要做的是以编程方式将新节点添加到xml中的任意位置:
<root>
<child>
</child>
</root>
(xml-add-element xml "hello" (xml-element-by-tagname xml "child"))
<root>
<child>
<hello></hello>
</child>
</root>
Run Code Online (Sandbox Code Playgroud)
编辑:我得到尽可能解析XML成口齿不清结构和编辑它xml.el和dom.el,但现在我需要把口齿不清结构回XML数据.