Notifications
Announcements
No record found.
Hi guys ,
when i m trying to read xml code through ax code , m getting error as :
XMLNode object not initialized.
*This post is locked for comments
We can't help you, if you don't share your code. The error says all there is to say. Maybe you specified a wrong xPath and don't get a XML node...
select * from Staging
where Staging.RecId == 5637144581;
_xmlMsg = Staging.OrderJson;
doc = new XmlDocument();
doc.loadXml(_xmlMsg);
xmlError = doc.parseError();
if(xmlError && xmlError.errorCode() != 0)
{
throw error(strFmt("XML Error: %1", xmlError.reason()));
}
//rootNode = doc.documentElement();
nodeNote = doc.documentElement().getNamedElement("name");
//rootNode = doc.getNamedElement(#paramsNode);
xmlRecordList = nodeNote.childNodes();
It should be really easy to identify the problem using the debugger.
Which line produces the error?
I assume it's
which means that there is not element with the name 'name', so the getNamedElement() functions returns null (no object) and you can't access childNodes() method of an uninstatiated object.
Check your XML structure and write your code accordingly.
www.w3schools.com/.../default.asp
msdn.microsoft.com/.../System.Xml%28v=vs.110%29.aspx
msdn.microsoft.com/.../system.xml.xmldocument%28v=vs.110%29.aspx
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Priya_K 4
Martin Dráb 4 Most Valuable Professional
Ali Zaidi 2