Skip to content

Instantly share code, notes, and snippets.

@antoinerg
Last active December 12, 2015 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antoinerg/4684891 to your computer and use it in GitHub Desktop.
Save antoinerg/4684891 to your computer and use it in GitHub Desktop.
Matlab function to parse XInclude in XML files
function xdoc = xmlread_xinclude(filename)
% Parse XML expanding XInclude tags
parserFactory = javaMethod('newInstance',...
'javax.xml.parsers.DocumentBuilderFactory');
javaMethod('setXIncludeAware',parserFactory,true);
javaMethod('setNamespaceAware',parserFactory,true);
p = javaMethod('newDocumentBuilder',parserFactory);
xdoc=xmlread(filename,p);
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment