How to replace data in an existing XML file?

9 ビュー (過去 30 日間)
Mark Golberg
Mark Golberg 2022 年 6 月 16 日
コメント済み: Geoff Hayes 2022 年 6 月 17 日
I have an XML file. It looks like in the attached pic.
As you can see, in action Name "m1" there are 2 cols: "fish_1" & "fish_2".
I also have a list with new col names: "moose_42" , "moose_7" , "moose_19"
I'd like to replace the existing list (2 col names) with the new list (3 col names). I know how to "dive" into action "m1" and replace attributes values. But because it's 3 new vs. 2 existing, I'd need to add one NEW node. How this can be done?
Also, what if in my new list there is only 1 name, then how can I DELETE the second node?
  6 件のコメント
Geoff Hayes
Geoff Hayes 2022 年 6 月 17 日
Or you may want to try the MAXP parser example found at


回答 (0 件)




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by