Bonjour,

Je crée un fichier XML avec matlab et celui-ci inclut automatiquement l'attribut encoding dans :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
<?xml version="1.0" encoding="utf-8"?>
alors que j'aimerais :

Quelqu'un saurait-il comment faire pour enlever ou modifier ça ?

Exemple de code actuel :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
 
docNode = com.mathworks.xml.XMLUtils.createDocument('opencv_storage','1.1');
opencv_storage = docNode.getDocumentElement;
 
% Distortion
Intrinsics = docNode.createElement('Intrinsics');
Intrinsics.setAttribute('type_id','opencv-matrix');
 
% rows
rows = docNode.createElement('rows');
rows.appendChild(docNode.createTextNode(sprintf('%i',3)));
Intrinsics.appendChild(rows);
% cols
cols = docNode.createElement('cols');
cols.appendChild(docNode.createTextNode(sprintf('%i',3)));
Intrinsics.appendChild(cols);
% dt
dt = docNode.createElement('dt');
dt.appendChild(docNode.createTextNode('f'));
Intrinsics.appendChild(dt);
% data
data = docNode.createElement('data');
dataStr = sprintf('%.8e %.8e %.8e %.8e %.8e %.8e %.8e %.8e %.8e',rand(3));
data.appendChild(docNode.createTextNode(dataStr));
Intrinsics.appendChild(data);
 
% /Distortion
opencv_storage.appendChild(Intrinsics);
 
%% Return results
 
% Save the sample document.
xmlwrite(filePath,docNode);
Merci !