How can I use a function, such as XMLREAD, to parse XML data from a string, instead of from a file in MATLAB 7.5 (R2007b)?
14 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
MathWorks Support Team
il 20 Mag 2010
Commentato: Walter Roberson
il 14 Ago 2020
I want to use a function, such as XMLREAD, to parse XML data from a string, instead of from a file.
Risposta accettata
MathWorks Support Team
il 20 Mag 2010
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);
1 Commento
Walter Roberson
il 14 Ago 2020
Thanks, Jasper, I was looking for something like that yesterday for https://www.mathworks.com/matlabcentral/answers/579150-failed-to-read-xml-error-when-using-xmlread?s_tid=srchtitle
Più risposte (0)
Vedere anche
Categorie
Scopri di più su String Parsing in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!