1.MATLAB 读 xml 文件
tempname = 'myxml';
docNode = com.mathworks.xml.XMLUtils.createDocument('obj')
docRootNode = docNode.getDocumentElement;
%docRootNode.setAttribute('attr_name','attr_value');
IDNode = docNode.createElement('ID');
IDNode.appendChild(docNode.createTextNode(sprintf('%i',5)));
docRootNode.appendChild(IDNode);
objNmNode = docNode.createElement('objNm');
objNmNode.appendChild(docNode.createTextNode(sprintf('plane###############
#####1008')));
docRootNode.appendChild(objNmNode);
thisElement = docNode.createElement('FDs');
docRootNode.appendChild(thisElement);
dataNode = docNode.createElement('FD1');
dataNode.appendChild(docNode.createTextNode(sprintf('4 43 3 32 1 6 0 3 1 2
')));
thisElement.appendChild(dataNode);
dataNode = docNode.createElement('FD2');
dataNode.appendChild(docNode.createTextNode(sprintf('4 43 3 32 1 6 0 3 1 2
')));
thisElement.appendChild(dataNode);
dataNode = docNode.createElement('FD3');
dataNode.appendChild(docNode.createTextNode(sprintf('4 43 3 32 1 6 0 3 1 2
')));
thisElement.appendChild(dataNode);
dataNode = docNode.createElement('FD4');
dataNode.appendChild(docNode.createTextNode(sprintf('4 43 3 32 1 6 0 3 1 2
')));
thisElement.appendChild(dataNode);
1