How to access to .xml nodes

2 views (last 30 days)
Corrado Giuliani
Corrado Giuliani on 2 Feb 2015
Edited: Corrado Giuliani on 2 Feb 2015
I've read many post on how to access to nodex of an xml document imported via xmlread and i've already downloaded xml2struct. By the way, i've got an .xml from a customer of mine which is private and i cant share, but i'm really stuck in accessing a child node from a machine he is using. Everytime i run parsexml, matlab crashes saying it runs out of java memory. For the same reason i cant use xml2struct neither. Any solution? I've tried also to access to nodes content as in this code
end
[xmlfilename,pathname]=uigetfile('*.xml');
openxmlfilename = fullfile(pathname,xmlfilename);
xDoc=xmlread(openxmlfilename) ;
import javax.xml.xpath.*
factory = XPathFactory.newInstance;
xpath = factory.newXPath;
expression = xpath.compile('Node 1/subnode1/childOFsubnode1/childofchild1/childofchild2/etc');
digitsNode = expression.evaluate(docNode, XPathConstants.STRING);
digits = digitsNode.getTextContent
Could it be for it being structured on too many levels (consider that information that i need are on 9-10th child level).

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!