I have been given an XML file and am trying to read it with xmlread. If I call it either of the following ways,
DOMNode = xmlread(fileXml, 'AllowDoctype', true);DOMNode = xmlread(fileXml, 'AllowDoctype', false);
xmlread crashes at the line indicated below,
try parseResult = p.parse(fileObj);catch ME % If trying to parse an XML document containing a DOCYTYPE declaration
% with 'AllowDoctype' set to false, then throw an appropriate error
% message.
if isa(ME, 'matlab.exception.JavaException') && ... contains(char(ME.ExceptionObject.getLocalizedMessage), ... 'http://apache.org/xml/features/disallow-doctype-decl') error(message('MATLAB:xmlread:DoctypeDisabled', filename)); end rethrow(ME); % crashes here
end
Best Answer