image thumbnail

XML Parse-n-Find

version (3.69 KB) by Sam Warner
XML parser and tag finder


Updated 6 Nov 2012

View License

Class Definition:

xmlelem - Handle class with dynamic property to hold an XML element data


xmlparse - Parse xml file to xmlelem class object tree
xmlfind - Wraps handle.findobj to traverse xmlelem tree

% Parse XML file to XMLELEM tree
T = xmlparse(fullfile(matlabroot,'toolbox','matlab','general','info.xml'))

% Flatten the tree
F = xmlfind(T)

% Find XML element text with 'matlab'
elem = xmlfind(T,'Name','#text','Value','matlab')

Cite As

Sam Warner (2022). XML Parse-n-Find (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2012b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!