嗨,我有一个现有的 XML 文件,想通过 Javascript 添加一个新条目(atm 没有任何形式或类似硬编码的东西),所以我的问题是如何处理它来添加一本新书。
<?xml version="1.0"?>
<catalog>
   <book id="bk101">
      <author>Gambardella, Matthew</author>
      <title>XML Developer's Guide</title>
      <genre>Computer</genre>
      <price>44.95</price>
      <publish_date>2000-10-01</publish_date>
      <description>An in-depth look at creating applications 
      with XML.</description>
   </book>
</catalog>