MATLAB: How to use a function, such as XMLREAD, to parse XML data from a string, instead of from a file in MATLAB 7.5 (R2007b)

MATLABstringxmlread

I want to use a function, such as XMLREAD, to parse XML data from a string, instead of from a file.

Best Answer

The ability to parse XML data from a string, instead of from a file is not available in MATLAB.
To work around this issue, use the attached file, 'XMLREADSTRING.m', which is a modified version of the XMLREAD function:
Sample usage:
% Parse.
myTestDoc = xmlreadstring('<data>Test</data>');
% Write to file in order to test.
xmlwrite('mytest.xml', myTestDoc);