I have a .XML file that looks like this:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Comments</key> <string></string> <key>DataSummary</key> <dict> <key>AreaCM2</key> <real>2.77</real> <key>Dev</key> <real>9.48</real> </dict> <key>DataValues</key> <array> <real>81</real> <real>85</real> </array> <key>ROIPoints</key> <array> <string>{65.7414, 58.2929}</string> <string>{65.7388, 58.4421}</string> </array> </dict> </plist>
I would like to access DataValues and ROIPoints using MATLAB .
I found a rather remote way to extract ROIPoints that works as follows:
DOMnode = xmlread(pathofxmlfile); i = DOMnode.getDocumentElement; f = char(i.getTextContent);
f is a string containing all the contents of "text":
f = CommentsDataSummaryAreaCM22.77Dev9.48DataValues8185ROIPoints**{65.7414, 58.2929}{65.7388, 58.4421}
Since ROIPoints enclosed in braces, I can manipulate the string to extract them.
Unfortunately, DataValues is horizontally concatenated (8185), and I cannot extract them individually.
Any tips?
source share