相关疑难解决方法(0)

创建XML DOM元素,同时保持区分大小写

我正在尝试创建以下元素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.

javascript xml parsing

6
推荐指数
1
解决办法
1094
查看次数

标签 统计

javascript ×1

parsing ×1

xml ×1