2

Having an xml file like this:

<?xml version="1.0" encoding="utf-8"?>
<Configuration>
  <Bla>
    BlaDiBla
  </Bla>
</Configuration>

I am wondering whether there is a more concise way to obtain 'BlaDiBla' using standard matlab (no additional toolbox) than this:

xmlfile = fullfile('C:\tttttt', 'Configuration.xml');
xDoc = xmlread(xmlfile);

char(xDoc.getElementsByTagName('Bla').item(0).getFirstChild.getData)

Thanks.

1 Answer 1

1

Try xml_io_tools from the File Exchange.

The syntax is:

  xmlfile = fullfile('C:\tttttt', 'Configuration.xml');
  struct = xml_load_any(xmlFile);
Sign up to request clarification or add additional context in comments.

2 Comments

I try to make this future proof. Do you reckon I can easily use this 'external' code in conjunction with matlab coder to produce C code?
@csetzkorn, I have no idea. Unfortunately their code is p-code, which means that nobody can see it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.