From: Øyvind on
I'm reading an xml file using Matlab's xmlread-function. For some reason searching for elements by id doesn't work for me. Here's an example:

File 'test.xml':

<?xml version="1.0" encoding="utf-8"?>
<Measurements>
<Setup id="a">
<myval>3</myval>
</Setup>
<Setup id="b">
<myval>4</myval>
</Setup>
</Measurements>

>> dom = xmlread('test.xml');
>> dom.getElementsByTagName('Setup')
ans =
org.apache.xerces.dom.DeepNodeListImpl(a)3e906
>> dom.getElementById('a')
ans =
[]

The first call, searching for elements by tagname works fine, but not searching by id. This should work, according to http://www.w3schools.com/jsref/met_doc_getelementbyid.asp

Does anyone see what's going on here?
 | 
Pages: 1
Prev: adding TFs in Matlab
Next: embed font export_fig