File Exchange

image thumbnail

Using XPath from MATLAB

version (3.39 KB) by

A simple example showing how to use XPath from MATLAB.

1 Download


View License

An XPath package started shipping as part of Java 5, so we can use it from MATLAB. This is a simple example showing how to use XPath from MATLAB.

Comments and Ratings (1)


Hi Matthew,

I need to extract data (e.g. all the noduleID) from my xml file, having a structure like the following (but with more 'unblindedReadNodule' nodes):

<?xml version="1.0" encoding="UTF-8"?>
<LidcReadMessage uid="" xmlns="" xmlns:xsi="" xsi:schemaLocation="">
<TaskDescription>Second unblinded read</TaskDescription>
<ResponseDescription>1 - Reading complete</ResponseDescription>
<noduleID>Nodule 001</noduleID>
<imageZposition>-125.000000 </imageZposition>

I tried to use your function, with only two appropriate changes:
doc = xmlread(which('myFileName.xml'));
expression = xpath.compile('//noduleID');
but I got no display!

Could you help me?

Thank you for your attention.



Updated license

MATLAB Release
MATLAB 7.5 (R2007b)
Tags Add Tags

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today