Filter löschen
Filter löschen

How can I modify an XML file and create a new XML file ?

51 Ansichten (letzte 30 Tage)
jules Angebault
jules Angebault am 5 Dez. 2020
Beantwortet: Anmol Dhiman am 10 Dez. 2020
close all
clear all
%% lecture fichier xml
V=xml2struct( 'V4_charles.xml');
%% Données
Angle_base=0:0.5:5; %angle de dièdre à la base de l'aile
Angle_tip=0:1:15; %angle dièdre tip
span=str2double(V.xflplane.Plane.wing{1, 1}.Sections.Section{1, 3}.yu_position.Text);
Pos_tip=(0.5:0.02:1)*span ; % position tip en poucentage du span de l'aile
%% modification fichier
for n=Angle_base;
temp.xflplane.Plane.wing{1, 1}.Sections.Section{1, 1}.Dihedral.Text=convertStringsToChars(n);% modificiation angle dièdre
filename=['V_' num2str(n) '.xml'];%%nouveau nom
xmlwrite(filename,temp); %écriture nouveau fichier xml
And I get these error messages:
No constructor 'javax.xml.transform.dom.DOMSource' with matching signature
Error in xmlwrite>xmlWriteHelper (line 131)
xSource = javax.xml.transform.dom.DOMSource(node);
Error in xmlwrite (line 78)
Error in plane_modification (line 17)
xmlwrite(filename,temp); %écriture nouveau fichier xml

Antworten (1)

Anmol Dhiman
Anmol Dhiman am 10 Dez. 2020
Hi Jules,
As mentioned in this Answer , use xmlread and xmlwrite to modify.
Anmol Dhiman

Community Treasure Hunt

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

Start Hunting!