mozilla

Revision 685 of Document Object Model (DOM)

  • Revision slug: DOM
  • Revision title: Document Object Model (DOM)
  • Revision id: 685
  • Created:
  • Creator: his3993
  • Is current revision? No
  • Comment Reverted to earlier version; 75 words added, 335 words removed

Revision Content

一、如何在firefox文件下写一个xml文件
如何实现以下xml文档
<Steel-ERP> <Head sid="899898132932"/> <Client job="new" file="1222" file1="eeee"> </Client> </Steel-ERP>

var oXmlDom = document.implementation.createDocument("","",null);
var oRoot = oXmlDom.documentElement;
var myChildren = oRoot.firstChild ;
var testnode = document.createElement("Steel-ERP");//根节点
myChildren.appendChild(testnode);
为何这样写不行呢??请高人指证

Revision Source

<p>一、如何在firefox文件下写一个xml文件 <br>
如何实现以下xml文档 <br>
&lt;Steel-ERP&gt; &lt;Head sid="899898132932"/&gt; &lt;Client job="new" file="1222" file1="eeee"&gt; &lt;/Client&gt; &lt;/Steel-ERP&gt; <br>
<br>
var oXmlDom = document.implementation.createDocument("","",null); <br>
var oRoot = oXmlDom.documentElement; <br>
var myChildren = oRoot.firstChild ; <br>
var testnode = document.createElement("Steel-ERP");//根节点 <br>
<span style="color: rgb(255,0,0)">myChildren.appendChild(testnode);</span> <br>
为何这样写不行呢??请高人指证</p>
Revert to this revision