Solved

XmlNode.SelectSingleNode and XPath issue

Posted on 2009-05-03
1
1,084 Views
Last Modified: 2013-12-14
why does the below code not work in that :
- mynode is undefined ?
- yet in Break debug mode i can see the root nicely containing the Function child node that im trying to filter with with SelectSingleNode


XmlDocument^ doc = gcnew XmlDocument;

		doc->Load(fileNamePath);

		

		XmlNode^ mynode;

		XmlNode^ root = doc->DocumentElement;

		// i checked no problems with xml file path or the root document up to here !

		String^ MyXPathQuery = "descendant::LastCue[Function='Default']";

		mynode = root->SelectSingleNode(MyXPathQuery);
 
 

//My XML file (fileNamePath) contents are the following:
 

<?xml version="1.0" encoding="us-ascii" standalone="yes"?><LastCue><Function>Default</Function><Time>52592</Time></LastCue>

Open in new window

0
Comment
Question by:KristjanLaane
1 Comment
 
LVL 27

Accepted Solution

by:
BigRat earned 500 total points
ID: 24293557
Because the Load operation is being performed asynchronously. Set XmlDoc.async to false.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org (http://seleniumhq.org) Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now