web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Variable XMLNode has not been declared. Thought it was a class!

(0) ShareShare
ReportReport
Posted on by 100

I'm writing a job that needs to insert required nodes into an XML document before having AIF scoop up the file. Anyway, I can declare XMLDocument to load the XML, but as soon as I try creating nodes from the document as this supposed class that is defined in MSDN's X++ reference, I get this error. What gives, how do I load these apparently missing libs?

*This post is locked for comments

I have the same question (0)
  • ACO Profile Picture
    350 on at
    Re: Variable XMLNode has not been declared. Thought it was a class!

    Stephale:

    You have to create the XMLNode in the XMLDocument before you can append it. An overly simplified example is:

       XMLDocument                 xmlDoc;

       XMLNode                     node;

       ;

       xmlDoc = new XMLDocument();

       node = xmlDoc.createElement('MYNODE');

       node.text('MyText');

       xmlDoc.appendChild(node);

       info(xmlDoc.xml());

    The return from "xmlDoc().root()" is an XMLNode. To operate at a deeper level, just replace it with an XMLNode of the level you are working on.

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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 2 Most Valuable Professional

#1
Guy Terry Profile Picture

Guy Terry 2 Moderator

#1
Community Member Profile Picture

Community Member 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans