Hi !
I am getting an error, when I am trying to read an XML file . The function body for reading an xml looks like this :-
XmlNodeList := XmlDom.getElementsByTagName('first');
XmlNode := XmlNodeList.item(0);
VMsg:=XmlNode.selectNodes('msg').item(0).text;
MESSAGE(VMsg);
where XMLNodeList is an automation datatype with the subtype as 'Microsoft XML, v4.0'.IXMLDOMNodeList
XML Node is also automation datatype with subtype as 'Microsoft XML, v4.0'.IXMLDOMNode
The error is like this :-
This message is for the C/AL programmers :-
You must instantiate/assign the automation variable.
If someone can throw some light on this , it would be of extreme help for me.
Subhasish Chakraborty,
Systems Analyst,
MBS Dynamics.
0
Comments
If isclear(xmldom) then
Create(xmldom);
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Systems Analyst,
MBS Dynamics.
My guess it stops
XmlNode := XmlNodeList.item(0);
which means XmlDom.getElementsByTagName('first'); returns a null.
Make sure 'first' is a xml tag.
in the xml file
<first> something</first>
If you put your xml file structure it would help.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
i ,by mistake, was passing an xml file like this :-
<first><msg>this is test</msg></first>
in to the message queue. But unfortunately, it was apparently an XML file , but actually , it was getting sent in to the MSMQ as a text file.
As a result , <first> was not a tag !
Thanks !
Systems Analyst,
MBS Dynamics.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n