php怎么修改xml元素名称

WBOY
Release: 2016-06-23 13:20:54
Original
1016 people have browsed it

$v="abc";
$note"->item(0)->getElementsByTagName("name")->item(0)->nodeName=$v;//把名称为name修改成$v,但nodeName只读,这样不行
是不是会有修改的方法,比如xml元素属性,或值都是可以修改,为什么名称却不能修改


回复讨论(解决方案)

插入新节点,删除老节点


但在原标签内有很多字节点,要怎么获取内容插入新节点
类似js在html内可以这样,获取所有节点内容
value=oldnode.innerHTML ;
newnode.innerHTML = value;
这个有没有类似的方法

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template