質問編集履歴

2

リンクを入れました。例のコードを書きました。

2016/08/19 14:57

投稿

xxx_aoi
xxx_aoi

スコア38

test CHANGED
File without changes
test CHANGED
@@ -1,10 +1,20 @@
1
- xmlのファイル
1
+ xmlのファイル
2
+
3
+ <?xml version="1.0" encoding="Shift-Jis" ?>
4
+
5
+ <root>
6
+
7
+ <section id =0001 name="ああああ"/>
8
+
9
+ <root>
10
+
11
+ 内の
2
12
 
3
13
  <section id =0001 name="ああああ"/>
4
14
 
5
15
  といった複数の属性を持つ要素をphpで削除したいのですが、方法がわかりません。
6
16
 
7
- 参考としたページ: http://www.weblio.jp/content/DOMNode-%3EremoveChild()
17
+ 参考としたページ: [http://www.weblio.jp/content/DOMNode-%3EremoveChild()]
8
18
 
9
19
 
10
20
 
@@ -14,7 +24,7 @@
14
24
 
15
25
  参考サイト:
16
26
 
17
- http://www.technotype.net/tutorial/tutorial.php?fileId=%7BPHP%7D&sectionId=%7Bremoving-the-element-and-attribute-node%7D
27
+ [http://www.technotype.net/tutorial/tutorial.php?fileId=%7BPHP%7D&sectionId=%7Bremoving-the-element-and-attribute-node%7D]
18
28
 
19
29
 
20
30
 

1

リンク先を直しました。

2016/08/19 14:57

投稿

xxx_aoi
xxx_aoi

スコア38

test CHANGED
File without changes
test CHANGED
@@ -6,9 +6,17 @@
6
6
 
7
7
  参考としたページ: http://www.weblio.jp/content/DOMNode-%3EremoveChild()
8
8
 
9
+
10
+
9
11
  ただこれを読んでももともとどこにcaptionタグがあってどのように削除されたのかがよくわかりませんでした。
10
12
 
13
+ また、unsetを使った方法も試したんですが:
14
+
15
+ 参考サイト:
16
+
11
- また、unsetを使った方法も試したんですが、http://www.technotype.net/tutorial/tutorial.php?fileId=%7BPHP%7D&se...
17
+ http://www.technotype.net/tutorial/tutorial.php?fileId=%7BPHP%7D&sectionId=%7Bremoving-the-element-and-attribute-node%7D
18
+
19
+
12
20
 
13
21
  <section>ああああ</section>といった属性1つだけの時では削除できる(xmlファイル自体では消えてないがブラウザ表示では消えてる)んですが、やはり多くの属性を含んだ要素の場合は消せません。
14
22