Solved

XmlNode.SelectSingleNode and XPath issue

Posted on 2009-05-03
1
1,086 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

776 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