I have an XSD for an XML file, which I was hoping would make it easier to parse and store the information in the XML. However, I am unable to find anything on the Mathworks website about such a thing. Does anyone know of a way to use my XSD to read the XML file (with MATLAB, if possible) and store the information contained in the XML file? Alternatively, is there some other way to do this (ie without MATLAB)?
Asked
Active
Viewed 2,378 times
2 Answers
1
Look, I've tried multiple options to read/write XML files. And believe me when I tell you, all of them are not as good as you might think!
The best solution I've reached and used finally, is to use JAXB to create your parser java classes from XSD, then include your java package into Matlab and use it.

Community
- 1
- 1

Hazem Elraffiee
- 453
- 7
- 16
-
1Again, I'm not sure what the OP intended, but for my purposes, all I needed was a way to validate (in Matlab) my XML based on an XSD. I chose to use Greg Aloe's advice here (https://www.mathworks.com/matlabcentral/newsreader/view_thread/156764) which worked great. – Michael Repucci Dec 05 '13 at 21:38
-
If you're just validating, sure this is a great solution. I'm happy you shared it with me :) But in case you needed a good data structure to read and write XML based upon XSD, use the method above. – Hazem Elraffiee Dec 09 '13 at 07:15
0
See this: http://www.artefact.tk/software/matlab/xml/
That should help you!

Hazem Elraffiee
- 453
- 7
- 16
-
Note exactly sure what the OP intended, but that toolbox says "[XMLTree] is currently not a validating XML processor." – Michael Repucci Nov 15 '13 at 17:11