我正在尝试创建以下元素nodetree:
<v:custProps>
<v:cp v:nameU="Cost">
</v:custProps>
Run Code Online (Sandbox Code Playgroud)
有:
newCustprop = document.createElement("v:custProps");
newcp = document.createElement("v:cp");
newcp.setAttribute("v:nameU", "Cost");
newCustprop.appendChild(newcp);
Run Code Online (Sandbox Code Playgroud)
但是,document.createElement("v:custProps")生成<v:custprops>而不是<v:custProps>.反正有逃避这种解析?
编辑1:
我目前正在读此文章节点名的大小写敏感性.这与我的问题有点无关,因为我的代码没有被解析,<![CDATA]]>我宁愿不使用.innerHTML.