How to delete a node from DOM object?

5 Ansichten (letzte 30 Tage)
Keerthana R O
Keerthana R O am 21 Jul. 2021
Beantwortet: Fangjun Jiang am 29 Jul. 2021
I have an xml file with code similar to the one below
<FS>
<F1 Name="abc" Val="0" />
</FS>
This is read from the xml file and stored in a variable called xDoc. How to make it like below code?
<FS>
</FS>
If I try removeChild(), remove() and other similar methods I keep getting error. Please suggest an any other way.

Antworten (1)

Fangjun Jiang
Fangjun Jiang am 29 Jul. 2021
use delete() and then write the xDoc to an XML file.

Community Treasure Hunt

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

Start Hunting!

Translated by