MATLAB: Doesn’t the XMLREAD function work properly in MATLAB 6.5 (R13)

docnodegetdocumenttypeMATLABxmlread

Why doesn't the XMLREAD function work properly in MATLAB 6.5 (R13)?
I get an error message when I call the GetNodeType method on a document node created with XMLREAD.
For example:
docNode = xmlread( 'myxmlfile.xml')
docNode =
[#document: null]
docNodeType = docNode.GetNodeType
??? No appropriate method or public field GetNodeType for class
org.apache.xerces.dom.DeferredDocumentImpl.
I cannot find documentation for "DeferredDocumentImpl". Does XMLREAD work yet?

Best Answer

The error:
??? No appropriate method or public field GetNodeType for class
org.apache.xerces.dom.DeferredDocumentImpl.
is caused by the fact that method names are case-sensitive and MATLAB did not recognize the "GetNodeType" method. The correct method is "getNodeType".
MATLAB supports tab-completion, and this will help reduce typing errors at the command prompt. For example, typing:
docNode.get
Then, press the tab key to bring up a list of possible completions for the keyword.