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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

selectSingleNode

(0) ShareShare
ReportReport
Posted on by 15

HI

Im have a problem. the call to XmlNodeList.nextNode not running:

XmlNode : =  xmldom.selectSingleNode('namenode');

XmlNode : = XmlNodeList.item(0); 

XmlNode.selectSingleNode('namenode/text()'); 

REPEAT      

IF NOT ISNULL(XmlNode) THEN BEGIN      

      bigTxTem.ADDTEXT(XmlNode.text);                 

or

rec.fieldVarText := XmlNode.text;

rec.insert;

end;

XmlNodeList.nextNode;  /// ERROR NO STEP TO NEXT NODE

UNTIL ISNULL(XmlNode);

--------------------

have alternative to extract the text value of estructure of varios "nodes" of same name:

<nodename0>
  <nodename1>
    <nodename>Value01</nodename>
  </nodename1>
  <nodename1>
    <nodename>value02</nodename>
  </nodename1>
  <nodename1>
    <nodename>value03</nodename>
  </nodename1>
</nodename1
>

 

tanks!!

 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    Selects THE FIRST XmlNode that matches the XPath expression.

    If the XML is what you show here, XmlNode.selectSingleNode('namenode/text()'); is not clear.

    If you want to retrieve all nodes values, use something like:

    CREATE(XMLDoc);

    XMLDoc.load(FileName);

    //Gets a list of Items to loop through

    XMLNodeList := XMLDoc.selectNodes('//nodename');

    FOR Counter := 1 TO XMLNodeList.length DO BEGIN

     XMLNode := XMLNodeList.item(Counter-1);

     Message('%1',XMLNode.text());

    END;

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans