RosettaCodeData/Task/XML-DOM-serialization/MATLAB/xml-dom-serialization.m

6 lines
256 B
Matlab

docNode = com.mathworks.xml.XMLUtils.createDocument('root');
docRootNode = docNode.getDocumentElement;
thisElement = docNode.createElement('element');
thisElement.appendChild(docNode.createTextNode('Some text here'));
docRootNode.appendChild(thisElement);